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

Commit 39b25def authored by Thiébaud Weksteen's avatar Thiébaud Weksteen
Browse files

Enable PermissionAnnotationDetector for services.accessibility

Enable the linter and capture the current status by annotating Stub
classes with @SuppressWarnings.

The intent of this series of change is to ensure that all exposed Binder
methods from system_server are annotated. Service owners can start using
the following annotations on each method:
- @EnforcePermission, if a permission is required. The same annotation
  will be defined on the AIDL interface definition.
- @RequiresNoPermission, if no permission is required.
- @PermissionManuallyEnforced, if a specific mechanism to enforce
  permission is required.

See go/aidl-enforce-howto for more background information and details on
how to migrate interfaces.

Test: m lint-check
Bug: 220214993
Change-Id: I4a6a48545251dfccad4464bb76a219005d7633b2
parent 2559674d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,9 @@ java_library_static {
    defaults: [
        "platform_service_defaults",
    ],
    lint: {
        error_checks: ["MissingPermissionAnnotation"],
    },
    srcs: [
        ":services.accessibility-sources",
        "//frameworks/base/packages/SettingsLib/RestrictedLockUtils:SettingsLibRestrictedLockUtilsSrc",
+1 −0
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ import java.util.Set;
 * This class represents an accessibility client - either an AccessibilityService or a UiAutomation.
 * It is responsible for behavior common to both types of clients.
 */
@SuppressWarnings("MissingPermissionAnnotation")
abstract class AbstractAccessibilityServiceConnection extends IAccessibilityServiceConnection.Stub
        implements ServiceConnection, IBinder.DeathRecipient, KeyEventDispatcher.KeyEventFilter,
        FingerprintGestureDispatcher.FingerprintGestureClient {
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ import java.util.StringJoiner;
 *
 * NOTE: This class has to be created and poked only from the main thread.
 */
@SuppressWarnings("MissingPermissionAnnotation")
class AccessibilityInputFilter extends InputFilter implements EventStreamTransformation {

    private static final String TAG = AccessibilityInputFilter.class.getSimpleName();
+1 −0
Original line number Diff line number Diff line
@@ -195,6 +195,7 @@ import java.util.function.Predicate;
 * event dispatch for {@link AccessibilityEvent}s generated across all processes
 * on the device. Events are dispatched to {@link AccessibilityService}s.
 */
@SuppressWarnings("MissingPermissionAnnotation")
public class AccessibilityManagerService extends IAccessibilityManager.Stub
        implements AbstractAccessibilityServiceConnection.SystemSupport,
        AccessibilityUserState.ServiceInfoChangeListener,
+1 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ import java.util.Set;
 * passed to the service it represents as soon it is bound. It also serves as the
 * connection for the service.
 */
@SuppressWarnings("MissingPermissionAnnotation")
class AccessibilityServiceConnection extends AbstractAccessibilityServiceConnection {
    private static final String LOG_TAG = "AccessibilityServiceConnection";

Loading