diff options
author | Steven Moreland <smoreland@google.com> | 2022-03-10 18:25:59 +0000 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2022-03-14 17:02:41 +0000 |
commit | 9ab1a9ef674d125e64e7ce8ca0f6bd79bda00f4a (patch) | |
tree | c28a9b90b1bd6940dc6ba82112c4896e375a9f1f | |
parent | 9dbf96095eb6e48385adab101402dc52fdc15637 (diff) | |
download | aidl-9ab1a9ef674d125e64e7ce8ca0f6bd79bda00f4a.tar.gz |
Remove @Hide.
Doesn't work. Untested. Not used.
(use @hide in comments instead)
Fixes: 223692894
Test: aidl_unittests
Change-Id: I5766fe6fce29a1775e17c86b4718587f258c4b23
-rw-r--r-- | aidl_checkapi.cpp | 1 | ||||
-rw-r--r-- | aidl_language.cpp | 5 | ||||
-rw-r--r-- | aidl_language.h | 2 | ||||
-rw-r--r-- | aidl_unittest.cpp | 26 | ||||
-rw-r--r-- | generate_java.cpp | 3 | ||||
-rw-r--r-- | tests/aidl_parser_fuzzer.dict | 1 |
6 files changed, 3 insertions, 35 deletions
diff --git a/aidl_checkapi.cpp b/aidl_checkapi.cpp index 57e0d2b6..c1d3c66b 100644 --- a/aidl_checkapi.cpp +++ b/aidl_checkapi.cpp @@ -76,7 +76,6 @@ static vector<string> get_strict_annotations(const AidlAnnotatable& node) { // - a new implementation might start accepting null values (add @nullable) static const set<AidlAnnotation::Type> kIgnoreAnnotations{ AidlAnnotation::Type::NULLABLE, - AidlAnnotation::Type::HIDE, // @JavaDerive doesn't affect read/write AidlAnnotation::Type::JAVA_DERIVE, AidlAnnotation::Type::JAVA_DEFAULT, diff --git a/aidl_language.cpp b/aidl_language.cpp index c8353960..62bde98e 100644 --- a/aidl_language.cpp +++ b/aidl_language.cpp @@ -143,7 +143,6 @@ const std::vector<AidlAnnotation::Schema>& AidlAnnotation::AllSchemas() { "JavaOnlyStableParcelable", CONTEXT_TYPE_UNSTRUCTURED_PARCELABLE, {}}, - {AidlAnnotation::Type::HIDE, "Hide", CONTEXT_TYPE | CONTEXT_MEMBER, {}}, {AidlAnnotation::Type::BACKING, "Backing", CONTEXT_TYPE_ENUM, @@ -518,10 +517,6 @@ bool AidlAnnotatable::IsStableApiParcelable(Options::Language lang) const { GetAnnotation(annotations_, AidlAnnotation::Type::JAVA_STABLE_PARCELABLE); } -bool AidlAnnotatable::IsHide() const { - return GetAnnotation(annotations_, AidlAnnotation::Type::HIDE); -} - bool AidlAnnotatable::JavaDerive(const std::string& method) const { auto annotation = GetAnnotation(annotations_, AidlAnnotation::Type::JAVA_DERIVE); if (annotation != nullptr) { diff --git a/aidl_language.h b/aidl_language.h index 1e526256..f3c5829d 100644 --- a/aidl_language.h +++ b/aidl_language.h @@ -225,7 +225,6 @@ class AidlAnnotation : public AidlNode { public: enum class Type { BACKING = 1, - HIDE, JAVA_STABLE_PARCELABLE, UNSUPPORTED_APP_USAGE, VINTF_STABILITY, @@ -355,7 +354,6 @@ class AidlAnnotatable : public AidlCommentable { bool IsJavaOnlyImmutable() const; bool IsFixedSize() const; bool IsStableApiParcelable(Options::Language lang) const; - bool IsHide() const; bool JavaDerive(const std::string& method) const; bool IsJavaDefault() const; bool IsJavaDelegator() const; diff --git a/aidl_unittest.cpp b/aidl_unittest.cpp index 632cded6..5836b9b2 100644 --- a/aidl_unittest.cpp +++ b/aidl_unittest.cpp @@ -322,16 +322,6 @@ TEST_P(AidlTest, RejectsDuplicatedFieldNames) { EXPECT_EQ(expected_stderr, GetCapturedStderr()); } -TEST_P(AidlTest, RejectsRepeatedAnnotations) { - const string method = R"(@Hide @Hide parcelable Foo {})"; - const string expected_stderr = - "ERROR: Foo.aidl:1.23-27: 'Hide' is repeated, but not allowed. Previous location: " - "Foo.aidl:1.1-6\n"; - CaptureStderr(); - EXPECT_EQ(nullptr, Parse("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())); @@ -681,7 +671,8 @@ TEST_P(AidlTest, AcceptsAnnotatedOnewayMethod) { TEST_P(AidlTest, AnnotationsInMultiplePlaces) { const string oneway_method = - "package a; interface IFoo { @UnsupportedAppUsage oneway @Hide void f(int a); }"; + "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(); @@ -694,7 +685,7 @@ TEST_P(AidlTest, AnnotationsInMultiplePlaces) { // TODO(b/151102494): these annotations should be on the method ASSERT_NE(nullptr, ret_type.UnsupportedAppUsage()); - ASSERT_TRUE(ret_type.IsHide()); + ASSERT_TRUE(ret_type.IsPropagateAllowBlocking()); } TEST_P(AidlTest, AnnotationValueAttribute) { @@ -5117,17 +5108,6 @@ TEST_F(AidlTest, FormatCommentsForJava) { } } -TEST_F(AidlTest, HideIsNotForArgs) { - io_delegate_.SetFileContents("IFoo.aidl", - "interface IFoo {\n" - " void foo(in @Hide int x);\n" - "}"); - auto options = Options::From("aidl --lang=java IFoo.aidl"); - CaptureStderr(); - EXPECT_FALSE(compile_aidl(options, io_delegate_)); - EXPECT_THAT(GetCapturedStderr(), HasSubstr("@Hide is not available")); -} - TEST_F(AidlTest, SuppressWarningsIsNotForArgs) { io_delegate_.SetFileContents( "IFoo.aidl", diff --git a/generate_java.cpp b/generate_java.cpp index a8dd2324..1d21792d 100644 --- a/generate_java.cpp +++ b/generate_java.cpp @@ -904,9 +904,6 @@ std::string GenerateJavaUnsupportedAppUsageParameters(const AidlAnnotation& a) { std::vector<std::string> GenerateJavaAnnotations(const AidlAnnotatable& a) { std::vector<std::string> result; - if (a.IsHide()) { - result.emplace_back("@android.annotation.Hide"); - } const AidlAnnotation* unsupported_app_usage = a.UnsupportedAppUsage(); if (unsupported_app_usage != nullptr) { diff --git a/tests/aidl_parser_fuzzer.dict b/tests/aidl_parser_fuzzer.dict index eb2d8ce1..20a270ac 100644 --- a/tests/aidl_parser_fuzzer.dict +++ b/tests/aidl_parser_fuzzer.dict @@ -49,7 +49,6 @@ " @SystemApi " " @JavaPassthrough " " @JavaOnlyStableParcelable " -" @Hide " " @Backing " " @FixedSize " " @Descriptor " |