From 833fbf46f949dbb450e715dbdfe1411f56aa5d3a Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Wed, 21 Dec 2022 16:53:56 +0900 Subject: --dumpapi doesn't inline constants Due to constant inlining, some AIDL types referencing other type's constants lose the type references in the snapshot. This causes CPP/NDK clients relying on the fact of including headers of referenced types break after *-freeze-api. (See the REPRO in Iab358e15d4400fb43ec9d2812ac37c32af127323) Now, constant references are not inlined when creating API dumps. Bug: 262594867 Test: aidl_unittests Test: m client-using-test-piece-3 # OK m test-piece-3-freeze-api # OK m client-using-test-piece-3 # OK Change-Id: I4e8d8e03c70c6168942bcd95b7db39c29c65aeea --- aidl_checkapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'aidl_checkapi.cpp') diff --git a/aidl_checkapi.cpp b/aidl_checkapi.cpp index c1d3c66b..584e5a66 100644 --- a/aidl_checkapi.cpp +++ b/aidl_checkapi.cpp @@ -44,7 +44,7 @@ using std::vector; static std::string Dump(const AidlDefinedType& type) { string code; CodeWriterPtr out = CodeWriter::ForString(&code); - DumpVisitor visitor(*out); + DumpVisitor visitor(*out, /*inline_constants=*/true); type.DispatchVisit(visitor); out->Close(); return code; -- cgit v1.2.3