Merge "Initialize SystemActionPerformer lazily" into rvc-dev
This commit is contained in:
@@ -201,7 +201,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;
|
||||
|
||||
@@ -299,8 +300,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);
|
||||
@@ -677,7 +676,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);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -690,7 +689,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
|
||||
@@ -802,7 +809,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());
|
||||
}
|
||||
@@ -1522,7 +1529,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;
|
||||
@@ -2804,7 +2811,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;
|
||||
|
||||
Reference in New Issue
Block a user