Merge "Enable PermissionAnnotationDetector for services.accessibility" into main

This commit is contained in:
Thiébaud Weksteen 2023-12-14 04:48:39 +00:00 committed by Android (Google) Code Review
commit cc024fb28d
11 changed files with 13 additions and 0 deletions

View File

@ -19,6 +19,9 @@ java_library_static {
defaults: [ defaults: [
"platform_service_defaults", "platform_service_defaults",
], ],
lint: {
error_checks: ["MissingPermissionAnnotation"],
},
srcs: [ srcs: [
":services.accessibility-sources", ":services.accessibility-sources",
"//frameworks/base/packages/SettingsLib/RestrictedLockUtils:SettingsLibRestrictedLockUtilsSrc", "//frameworks/base/packages/SettingsLib/RestrictedLockUtils:SettingsLibRestrictedLockUtilsSrc",

View File

@ -118,6 +118,7 @@ import java.util.Set;
* This class represents an accessibility client - either an AccessibilityService or a UiAutomation. * This class represents an accessibility client - either an AccessibilityService or a UiAutomation.
* It is responsible for behavior common to both types of clients. * It is responsible for behavior common to both types of clients.
*/ */
@SuppressWarnings("MissingPermissionAnnotation")
abstract class AbstractAccessibilityServiceConnection extends IAccessibilityServiceConnection.Stub abstract class AbstractAccessibilityServiceConnection extends IAccessibilityServiceConnection.Stub
implements ServiceConnection, IBinder.DeathRecipient, KeyEventDispatcher.KeyEventFilter, implements ServiceConnection, IBinder.DeathRecipient, KeyEventDispatcher.KeyEventFilter,
FingerprintGestureDispatcher.FingerprintGestureClient { FingerprintGestureDispatcher.FingerprintGestureClient {

View File

@ -57,6 +57,7 @@ import java.util.StringJoiner;
* *
* NOTE: This class has to be created and poked only from the main thread. * NOTE: This class has to be created and poked only from the main thread.
*/ */
@SuppressWarnings("MissingPermissionAnnotation")
class AccessibilityInputFilter extends InputFilter implements EventStreamTransformation { class AccessibilityInputFilter extends InputFilter implements EventStreamTransformation {
private static final String TAG = AccessibilityInputFilter.class.getSimpleName(); private static final String TAG = AccessibilityInputFilter.class.getSimpleName();

View File

@ -195,6 +195,7 @@ import java.util.function.Predicate;
* event dispatch for {@link AccessibilityEvent}s generated across all processes * event dispatch for {@link AccessibilityEvent}s generated across all processes
* on the device. Events are dispatched to {@link AccessibilityService}s. * on the device. Events are dispatched to {@link AccessibilityService}s.
*/ */
@SuppressWarnings("MissingPermissionAnnotation")
public class AccessibilityManagerService extends IAccessibilityManager.Stub public class AccessibilityManagerService extends IAccessibilityManager.Stub
implements AbstractAccessibilityServiceConnection.SystemSupport, implements AbstractAccessibilityServiceConnection.SystemSupport,
AccessibilityUserState.ServiceInfoChangeListener, AccessibilityUserState.ServiceInfoChangeListener,

View File

@ -65,6 +65,7 @@ import java.util.Set;
* passed to the service it represents as soon it is bound. It also serves as the * passed to the service it represents as soon it is bound. It also serves as the
* connection for the service. * connection for the service.
*/ */
@SuppressWarnings("MissingPermissionAnnotation")
class AccessibilityServiceConnection extends AbstractAccessibilityServiceConnection { class AccessibilityServiceConnection extends AbstractAccessibilityServiceConnection {
private static final String LOG_TAG = "AccessibilityServiceConnection"; private static final String LOG_TAG = "AccessibilityServiceConnection";

View File

@ -34,6 +34,7 @@ import java.util.List;
* If we are stripping and/or replacing the actions from a window, we need to intercept the * If we are stripping and/or replacing the actions from a window, we need to intercept the
* nodes heading back to the service and swap out the actions. * nodes heading back to the service and swap out the actions.
*/ */
@SuppressWarnings("MissingPermissionAnnotation")
public class ActionReplacingCallback extends IAccessibilityInteractionConnectionCallback.Stub { public class ActionReplacingCallback extends IAccessibilityInteractionConnectionCallback.Stub {
private static final boolean DEBUG = false; private static final boolean DEBUG = false;
private static final String LOG_TAG = "ActionReplacingCallback"; private static final String LOG_TAG = "ActionReplacingCallback";

View File

@ -33,6 +33,7 @@ import java.util.List;
/** /**
* Encapsulate fingerprint gesture logic * Encapsulate fingerprint gesture logic
*/ */
@SuppressWarnings("MissingPermissionAnnotation")
public class FingerprintGestureDispatcher extends IFingerprintClientActiveCallback.Stub public class FingerprintGestureDispatcher extends IFingerprintClientActiveCallback.Stub
implements Handler.Callback{ implements Handler.Callback{
private static final int MSG_REGISTER = 1; private static final int MSG_REGISTER = 1;

View File

@ -64,6 +64,7 @@ import java.util.Set;
* *
* TODO(241429275): Initialize this when a proxy is registered. * TODO(241429275): Initialize this when a proxy is registered.
*/ */
@SuppressWarnings("MissingPermissionAnnotation")
public class ProxyAccessibilityServiceConnection extends AccessibilityServiceConnection { public class ProxyAccessibilityServiceConnection extends AccessibilityServiceConnection {
private static final String LOG_TAG = "ProxyAccessibilityServiceConnection"; private static final String LOG_TAG = "ProxyAccessibilityServiceConnection";

View File

@ -245,6 +245,7 @@ class UiAutomationManager {
} }
} }
@SuppressWarnings("MissingPermissionAnnotation")
private class UiAutomationService extends AbstractAccessibilityServiceConnection { private class UiAutomationService extends AbstractAccessibilityServiceConnection {
private final Handler mMainHandler; private final Handler mMainHandler;

View File

@ -922,6 +922,7 @@ public class MagnificationConnectionManager implements
disableWindowMagnification(displayId, true); disableWindowMagnification(displayId, true);
} }
@SuppressWarnings("MissingPermissionAnnotation")
private class ConnectionCallback extends IMagnificationConnectionCallback.Stub implements private class ConnectionCallback extends IMagnificationConnectionCallback.Stub implements
IBinder.DeathRecipient { IBinder.DeathRecipient {
private boolean mExpiredDeathRecipient = false; private boolean mExpiredDeathRecipient = false;

View File

@ -246,6 +246,7 @@ class MagnificationConnectionWrapper {
return new RemoteAnimationCallback(callback, trace); return new RemoteAnimationCallback(callback, trace);
} }
@SuppressWarnings("MissingPermissionAnnotation")
private static class RemoteAnimationCallback extends private static class RemoteAnimationCallback extends
IRemoteMagnificationAnimationCallback.Stub { IRemoteMagnificationAnimationCallback.Stub {
private final MagnificationAnimationCallback mCallback; private final MagnificationAnimationCallback mCallback;