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

Commit 239c3ccd authored by Sally Yuen's avatar Sally Yuen Committed by Android (Google) Code Review
Browse files

Merge "Clear caller identity in register/unregisterA11yDisplayProxy"

parents 2745f0c4 5ff509da
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -3819,6 +3819,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
                    + "proxy-ed");
        }

        final long identity = Binder.clearCallingIdentity();
        try {
            mProxyManager.registerProxy(client, displayId, mContext,
                    sIdCounter++, mMainHandler, mSecurityPolicy, this, getTraceManager(),
                    mWindowManagerService, mA11yWindowManager);
@@ -3826,13 +3828,21 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
            synchronized (mLock) {
                notifyClearAccessibilityCacheLocked();
            }
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
        return true;
    }

    @Override
    public boolean unregisterProxyForDisplay(int displayId) throws RemoteException {
    public boolean unregisterProxyForDisplay(int displayId) {
        mSecurityPolicy.enforceCallingOrSelfPermission(Manifest.permission.MANAGE_ACCESSIBILITY);
        final long identity = Binder.clearCallingIdentity();
        try {
            return mProxyManager.unregisterProxy(displayId);
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
    }

    boolean isDisplayProxyed(int displayId) {