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

Commit 88dbe09e authored by Phil Weaver's avatar Phil Weaver Committed by android-build-merger
Browse files

Merge "Clear calling identity when binding a11y services" into nyc-dev am: b72c3065

am: e7da35f5

* commit 'e7da35f5':
  Clear calling identity when binding a11y services

Change-Id: Ib1b3839a2ced07c7c2900b4c741c16fb2e18871e
parents 5cf7d6f3 e7da35f5
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -2296,12 +2296,17 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
        public boolean bindLocked() {
            UserState userState = getUserStateLocked(mUserId);
            if (!mIsAutomation) {
                final long identity = Binder.clearCallingIdentity();
                try {
                    if (mService == null && mContext.bindServiceAsUser(
                            mIntent, this,
                            Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE_WHILE_AWAKE,
                            new UserHandle(mUserId))) {
                        userState.mBindingServices.add(mComponentName);
                    }
                } finally {
                    Binder.restoreCallingIdentity(identity);
                }
            } else {
                userState.mBindingServices.add(mComponentName);
                mService = userState.mUiAutomationServiceClient.asBinder();