Skip to content
Snippets Groups Projects
Commit e83d6c80 authored by Daniel Norman's avatar Daniel Norman
Browse files

Enforce permission INJECT_EVENTS for injecting to input filter.

Bug: 309426390
Test: atest CtsAccessibilityTestCases:AccessibilityManagerTest
Change-Id: I4a63583dcd1c7a7c388fb278ec1c1c53c135e934
parent ec36d3e3
No related branches found
No related tags found
No related merge requests found
......@@ -183,6 +183,11 @@ public final class UiAutomationConnection extends IUiAutomationConnection.Stub {
@Override
public void injectInputEventToInputFilter(InputEvent event) throws RemoteException {
synchronized (mLock) {
throwIfCalledByNotTrustedUidLocked();
throwIfShutdownLocked();
throwIfNotConnectedLocked();
}
mAccessibilityManager.injectInputEventToInputFilter(event);
}
......
......@@ -5232,6 +5232,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
@Override
public void injectInputEventToInputFilter(InputEvent event) {
mSecurityPolicy.enforceCallingPermission(Manifest.permission.INJECT_EVENTS,
"injectInputEventToInputFilter");
synchronized (mLock) {
final long endMillis =
SystemClock.uptimeMillis() + WAIT_INPUT_FILTER_INSTALL_TIMEOUT_MS;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment