Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98bf0b89 authored by Tudor Magirescu's avatar Tudor Magirescu
Browse files

Update exemptAidlInterfaces and PermissionAnnotationDetector's message

Update the exemptAidlInterfaces set to correspond to the current AOSP
set of AIDL Interfaces hosted by system_server.

Additionally, change PermissionAnnotationDetector's error message to
specify which permission annotations should be used for system_server
APIs.

Bug: 363248121
Test: PermissionAnnotationDetectorTest
Flag: EXEMPT lint check
Change-Id: I6577c799480a221e8be22109f1beff4f164052d0
parent e4de8c38
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ val exemptAidlInterfaces = setOf(
    "android.devicelock.IGetDeviceIdCallback",
    "android.devicelock.IGetKioskAppsCallback",
    "android.devicelock.IIsDeviceLockedCallback",
    "android.devicelock.IVoidResultCallback",
    "android.devicelock.ILockUnlockDeviceCallback",
    "android.federatedcompute.aidl.IExampleStoreCallback",
    "android.federatedcompute.aidl.IExampleStoreIterator",
    "android.federatedcompute.aidl.IExampleStoreIteratorCallback",
@@ -364,8 +364,6 @@ val exemptAidlInterfaces = setOf(
    "android.health.connect.aidl.IGetPriorityResponseCallback",
    "android.health.connect.aidl.IHealthConnectService",
    "android.health.connect.aidl.IInsertRecordsResponseCallback",
    "android.health.connect.aidl.IMedicalDataSourceResponseCallback",
    "android.health.connect.aidl.IMedicalResourcesResponseCallback",
    "android.health.connect.aidl.IMigrationCallback",
    "android.health.connect.aidl.IReadMedicalResourcesResponseCallback",
    "android.health.connect.aidl.IReadRecordsResponseCallback",
@@ -462,6 +460,7 @@ val exemptAidlInterfaces = setOf(
    "android.net.ipmemorystore.IOnBlobRetrievedListener",
    "android.net.ipmemorystore.IOnL2KeyResponseListener",
    "android.net.ipmemorystore.IOnNetworkAttributesRetrievedListener",
    "android.net.ipmemorystore.IOnNetworkEventCountRetrievedListener",
    "android.net.ipmemorystore.IOnSameL3NetworkResponseListener",
    "android.net.ipmemorystore.IOnStatusAndCountListener",
    "android.net.ipmemorystore.IOnStatusListener",
+4 −1
Original line number Diff line number Diff line
@@ -57,7 +57,10 @@ class PermissionAnnotationDetector : AidlImplementationDetector() {
            ISSUE_MISSING_PERMISSION_ANNOTATION,
            node,
            context.getLocation(node),
            "The method ${node.name} is not permission-annotated."
            """
                ${node.name} should be annotated with either @EnforcePermission, \
                @RequiresNoPermission or @PermissionManuallyEnforced.
            """.trimMargin()
        )
    }

+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ class PermissionAnnotationDetectorTest : LintDetectorTest() {
            .run()
            .expect(
                """
                src/frameworks/base/services/java/com/android/server/Bar.java:3: Error: The method testMethod is not permission-annotated. [MissingPermissionAnnotation]
                src/frameworks/base/services/java/com/android/server/Bar.java:3: Error: testMethod should be annotated with either @EnforcePermission, @RequiresNoPermission or @PermissionManuallyEnforced. [MissingPermissionAnnotation]
                    public void testMethod(int parameter1, int parameter2) { }
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                1 errors, 0 warnings