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

Commit 3e88d987 authored by Daniel Norman's avatar Daniel Norman Committed by Android Build Coastguard Worker
Browse files

Enforce permission INJECT_EVENTS for injecting to input filter.

Bug: 309426390
Test: atest CtsAccessibilityTestCases:AccessibilityManagerTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:e83d6c801bb4f97b9b4b54280ac9e1486e622313)
Merged-In: I4a63583dcd1c7a7c388fb278ec1c1c53c135e934
Change-Id: I4a63583dcd1c7a7c388fb278ec1c1c53c135e934
parent a8fb9fe9
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);
    }

+2 −0
Original line number Diff line number Diff line
@@ -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;