Add CharSequence into ignorable imports
java.lang.CharSequence is a built-in aidl type, so actually it doesn't
need to be imported explicitly. But for some legacy use case, added it
into allowlist
Bug: 169193089
Test: try "import java.lang.CharSequence"
Change-Id: Ia22ee4394a7394060233fcc7034d80241f8929b2
Merged-In: Ia22ee4394a7394060233fcc7034d80241f8929b2
(cherry picked from commit ee71eb3328a37d83111c527643f89af2b98367a8)
diff --git a/aidl_typenames.cpp b/aidl_typenames.cpp
index ad89c1c..51c26d7 100644
--- a/aidl_typenames.cpp
+++ b/aidl_typenames.cpp
@@ -82,9 +82,9 @@
}
bool AidlTypenames::IsIgnorableImport(const string& import) const {
- static set<string> ignore_import = {"android.os.IInterface", "android.os.IBinder",
- "android.os.Parcelable", "android.os.Parcel",
- "android.content.Context", "java.lang.String"};
+ 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
const bool in_ignore_import = ignore_import.find(import) != ignore_import.end();
// an already defined type doesn't need to be imported again unless it is from