Fix qualified name for nested type

For interface, there are various "class names": Bn, Bp, I, ...
Nested types are declared in "I-" (ClassNames::INTERFACE) class of
parent type when the parent type is "interface".

Bug: 285373289
Test: m aidl-test-interface-{cpp,ndk,rust,java}
Test: atest aidl_unittests aidl_integration_test
Change-Id: I1f2cdf2cbfd0e2c49acfaeca5c571ce349166e11
diff --git a/aidl_to_cpp_common.cpp b/aidl_to_cpp_common.cpp
index 9834c1a..72b0331 100644
--- a/aidl_to_cpp_common.cpp
+++ b/aidl_to_cpp_common.cpp
@@ -56,6 +56,9 @@
 }
 
 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);
@@ -235,7 +238,7 @@
 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 = parent->GetName() + "::" + q_name;
+    q_name = ClassName(*parent, ClassNames::MAYBE_INTERFACE) + "::" + q_name;
   }
   return q_name;
 }
diff --git a/aidl_to_cpp_common.h b/aidl_to_cpp_common.h
index e732641..94904cc 100644
--- a/aidl_to_cpp_common.h
+++ b/aidl_to_cpp_common.h
@@ -33,13 +33,14 @@
 
 // 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
+  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);
diff --git a/generate_cpp.cpp b/generate_cpp.cpp
index 1df8108..5d63168 100644
--- a/generate_cpp.cpp
+++ b/generate_cpp.cpp
@@ -703,8 +703,8 @@
 
   if (auto parent = interface.GetParentType(); parent) {
     out << fmt::format("DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE({}, {}, \"{}\")\n",
-                       GetQualifiedName(*parent), ClassName(interface, ClassNames::BASE),
-                       interface.GetDescriptor());
+                       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());
diff --git a/tests/android/aidl/tests/ITestService.aidl b/tests/android/aidl/tests/ITestService.aidl
index d00df2c..887a9c7 100644
--- a/tests/android/aidl/tests/ITestService.aidl
+++ b/tests/android/aidl/tests/ITestService.aidl
@@ -325,6 +325,13 @@
             int n;
             HasDeprecated m;
         }
+        interface NoPrefixInterface {
+            parcelable Nested {}
+            interface NestedNoPrefixInterface {
+                void foo();
+            }
+            void foo();
+        }
     }
 
     ICircular GetCircular(out CircularParcelable cp);
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
index dc73aea..e99af16 100644
--- 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
@@ -5442,3 +5442,241 @@
 }  // 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/include/android/aidl/tests/ITestService.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ITestService.h
index 2facdc2..66b39bf 100644
--- 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
@@ -266,6 +266,124 @@
     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;
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
index 274a8d1..fd7e869 100644
--- 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
@@ -4214,5 +4214,297 @@
         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".replace('$', '.');
+      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".replace('$', '.');
+        public void foo() throws android.os.RemoteException;
+      }
+    }
   }
 }
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
index 45b3853..f53d83c 100644
--- 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
@@ -5038,3 +5038,294 @@
 }  // 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)) { 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)) { 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/include/aidl/android/aidl/tests/ITestService.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ITestService.h
index 73c63e6..e250ccb 100644
--- 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
@@ -282,6 +282,124 @@
     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;
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
index 6f30022..1ade992 100644
--- 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
@@ -4580,6 +4580,296 @@
       }
     }
   }
+  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;
@@ -4589,4 +4879,7 @@
  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;
 }