Add further permission annotations
Introduce the @NoPermissionRequired annotation to explicitly declare
that an interface or method does not require any kind of permission when
called.
Add the @PermissionManuallyEnforced annotation to indicate that
permissions are manually verified within the implementation.
Ensure that these new annotations are not defined in a conflicted manner
with the @Enforce annotation.
Bug: 197828948
Test: atest --host aidl_unittests
Change-Id: Iff3b4c9c5d2a5b4c310d7a737b8d7628cc39ba20
diff --git a/aidl_language.h b/aidl_language.h
index 7e20e03..44e6f51 100644
--- a/aidl_language.h
+++ b/aidl_language.h
@@ -236,7 +236,9 @@
DESCRIPTOR,
RUST_DERIVE,
SUPPRESS_WARNINGS,
- ENFORCE,
+ PERMISSION_ENFORCE,
+ PERMISSION_NONE,
+ PERMISSION_MANUAL
};
using TargetContext = uint16_t;
@@ -355,6 +357,8 @@
const AidlAnnotation* BackingType() const;
std::vector<std::string> SuppressWarnings() const;
std::unique_ptr<perm::Expression> EnforceExpression() const;
+ bool IsPermissionManual() const;
+ bool IsPermissionNone() const;
// ToString is for dumping AIDL.
// Returns string representation of annotations.
@@ -1157,6 +1161,7 @@
std::string GetPreprocessDeclarationName() const override { return "interface"; }
bool CheckValid(const AidlTypenames& typenames) const override;
+ bool CheckValidPermissionAnnotations(const AidlMethod& m) const;
std::string GetDescriptor() const;
void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
};