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

Commit bd258aa3 authored by Sally Yuen's avatar Sally Yuen Committed by Automerger Merge Worker
Browse files

Merge "Laziliy initialize SystemActionPerformer" into rvc-dev am: 63f55707...

Merge "Laziliy initialize SystemActionPerformer" into rvc-dev am: 63f55707 am: 05153955 am: 12e1f17a am: b82d43f4

Change-Id: I65968232fda49c40c831322f1652be5e6d3b625f
parents e22d2db0 b82d43f4
Loading
Loading
Loading
Loading
+15 −8
Original line number Diff line number Diff line
@@ -197,7 +197,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub

    private final MainHandler mMainHandler;

    private final SystemActionPerformer mSystemActionPerformer;
    // Lazily initialized - access through getSystemActionPerfomer()
    private SystemActionPerformer mSystemActionPerformer;

    private MagnificationController mMagnificationController;

@@ -295,8 +296,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
        mActivityTaskManagerService = LocalServices.getService(ActivityTaskManagerInternal.class);
        mPackageManager = mContext.getPackageManager();
        mSecurityPolicy = new AccessibilitySecurityPolicy(mContext, this);
        mSystemActionPerformer =
                new SystemActionPerformer(mContext, mWindowManagerService, null, this);
        mA11yWindowManager = new AccessibilityWindowManager(mLock, mMainHandler,
                mWindowManagerService, this, mSecurityPolicy, this);
        mA11yDisplayListener = new AccessibilityDisplayListener(mContext, mMainHandler);
@@ -667,7 +666,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
        mSecurityPolicy.enforceCallerIsRecentsOrHasPermission(
                Manifest.permission.MANAGE_ACCESSIBILITY,
                FUNCTION_REGISTER_SYSTEM_ACTION);
        mSystemActionPerformer.registerSystemAction(actionId, action);
        getSystemActionPerformer().registerSystemAction(actionId, action);
    }

    /**
@@ -680,7 +679,15 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
        mSecurityPolicy.enforceCallerIsRecentsOrHasPermission(
                Manifest.permission.MANAGE_ACCESSIBILITY,
                FUNCTION_UNREGISTER_SYSTEM_ACTION);
        mSystemActionPerformer.unregisterSystemAction(actionId);
        getSystemActionPerformer().unregisterSystemAction(actionId);
    }

    private SystemActionPerformer getSystemActionPerformer() {
        if (mSystemActionPerformer == null) {
            mSystemActionPerformer =
                    new SystemActionPerformer(mContext, mWindowManagerService, null, this);
        }
        return mSystemActionPerformer;
    }

    @Override
@@ -792,7 +799,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
        synchronized (mLock) {
            mUiAutomationManager.registerUiTestAutomationServiceLocked(owner, serviceClient,
                    mContext, accessibilityServiceInfo, sIdCounter++, mMainHandler,
                    mSecurityPolicy, this, mWindowManagerService, mSystemActionPerformer,
                    mSecurityPolicy, this, mWindowManagerService, getSystemActionPerformer(),
                    mA11yWindowManager, flags);
            onUserStateChangedLocked(getCurrentUserStateLocked());
        }
@@ -1503,7 +1510,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
                if (service == null) {
                    service = new AccessibilityServiceConnection(userState, mContext, componentName,
                            installedService, sIdCounter++, mMainHandler, mLock, mSecurityPolicy,
                            this, mWindowManagerService, mSystemActionPerformer,
                            this, mWindowManagerService, getSystemActionPerformer(),
                            mA11yWindowManager, mActivityTaskManagerService);
                } else if (userState.mBoundServices.contains(service)) {
                    continue;
@@ -2741,7 +2748,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
                    userState, mContext,
                    COMPONENT_NAME, info, sIdCounter++, mMainHandler, mLock, mSecurityPolicy,
                    AccessibilityManagerService.this, mWindowManagerService,
                    mSystemActionPerformer, mA11yWindowManager, mActivityTaskManagerService) {
                    getSystemActionPerformer(), mA11yWindowManager, mActivityTaskManagerService) {
                @Override
                public boolean supportsFlagForNotImportantViews(AccessibilityServiceInfo info) {
                    return true;