diff options
| author | 2023-11-08 13:35:06 +1100 | |
|---|---|---|
| committer | 2023-11-08 13:49:30 +1100 | |
| commit | eb133bf3891f5db28a0f9d30e4848494feb13c7c (patch) | |
| tree | 2b3075192852001e5c796d12007323229f812787 /api/coverage/tools | |
| parent | 253698da790ebb76df2f5bee60362300ce004c6c (diff) | |
Ignore superMethods from non-Stub parents
In commit 9252e5ce, the logic did not ensure that the super method
belonged to the Stub class, and not any arbitrary method in a parent.
Refactor EnforcePermissionUtils by:
- Removing isContainedInSubclassOfStub() in favour of containingStub(),
which returns the Stub PsiClass. Document that this method does not
mean that the argument is necessary an AIDL-generated method.
- Update getContainingAidlInterface() to pass the PsiClass to
findSuperMethod. This ensures that only the Stub class and its
parents are considered.
- Drop the check for IINTERFACE_INTERFACE. This is already verified in
the inner call to isStub().
The same logic is applied manually to EnforcePermissionDetector, as each
condition in getContainingAidlInterface() raises a different error
message.
Add a test to confirm the behaviour of EnforcePermissionDetector.
Bug: 307433823
Test: atest --host AndroidGlobalLintCheckerTest
Test: atest --host AndroidFrameworkLintCheckerTest
Test: enforce_permission_counter
Change-Id: If791b6d8741e5db483589446484bb68061b67b70
Diffstat (limited to 'api/coverage/tools')
0 files changed, 0 insertions, 0 deletions