Loading services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +54 −18 Original line number Diff line number Diff line Loading @@ -2397,6 +2397,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { public static final int MSG_SEND_RELEVANT_EVENTS_CHANGED_TO_CLIENTS = 12; public static final int MSG_SEND_ACCESSIBILITY_BUTTON_TO_INPUT_FILTER = 13; public static final int MSG_SHOW_ACCESSIBILITY_BUTTON_CHOOSER = 14; public static final int MSG_INIT_SERVICE = 15; public MainHandler(Looper looper) { super(looper); Loading Loading @@ -2495,6 +2496,11 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { case MSG_SHOW_ACCESSIBILITY_BUTTON_CHOOSER: { showAccessibilityButtonTargetSelection(); } break; case MSG_INIT_SERVICE: { final Service service = (Service) msg.obj; service.initializeService(); } break; } } Loading Loading @@ -2950,20 +2956,31 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { if (userState.mBindingServices.contains(mComponentName) || mWasConnectedAndDied) { userState.mBindingServices.remove(mComponentName); mWasConnectedAndDied = false; try { mServiceInterface.init(this, mId, mOverlayWindowToken); onUserStateChangedLocked(userState); } catch (RemoteException re) { Slog.w(LOG_TAG, "Error while setting connection for service: " + service, re); binderDied(); } // Initialize the service on the main handler after we're done setting up for // the new configuration (for example, initializing the input filter). mMainHandler.obtainMessage(MainHandler.MSG_INIT_SERVICE, this).sendToTarget(); } else { binderDied(); } } } private void initializeService() { final IAccessibilityServiceClient serviceInterface; synchronized (mLock) { serviceInterface = mServiceInterface; } if (serviceInterface == null) return; try { serviceInterface.init(this, mId, mOverlayWindowToken); } catch (RemoteException re) { Slog.w(LOG_TAG, "Error while setting connection for service: " + serviceInterface, re); binderDied(); } } private boolean isCalledForCurrentUserLocked() { // We treat calls from a profile as if made by its parent as profiles // share the accessibility state of the parent. The call below Loading Loading @@ -3456,18 +3473,15 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return region; } MagnificationController magnificationController = getMagnificationController(); boolean forceRegistration = mSecurityPolicy.canControlMagnification(this); boolean initiallyRegistered = magnificationController.isRegisteredLocked(); if (!initiallyRegistered && forceRegistration) { magnificationController.register(); } boolean registeredJustForThisCall = registerMagnificationIfNeeded(magnificationController); final long identity = Binder.clearCallingIdentity(); try { magnificationController.getMagnificationRegion(region); return region; } finally { Binder.restoreCallingIdentity(identity); if (!initiallyRegistered && forceRegistration) { if (registeredJustForThisCall) { magnificationController.unregister(); } } Loading @@ -3481,11 +3495,17 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return 0.0f; } } MagnificationController magnificationController = getMagnificationController(); boolean registeredJustForThisCall = registerMagnificationIfNeeded(magnificationController); final long identity = Binder.clearCallingIdentity(); try { return getMagnificationController().getCenterX(); return magnificationController.getCenterX(); } finally { Binder.restoreCallingIdentity(identity); if (registeredJustForThisCall) { magnificationController.unregister(); } } } Loading @@ -3496,13 +3516,29 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return 0.0f; } } MagnificationController magnificationController = getMagnificationController(); boolean registeredJustForThisCall = registerMagnificationIfNeeded(magnificationController); final long identity = Binder.clearCallingIdentity(); try { return getMagnificationController().getCenterY(); return magnificationController.getCenterY(); } finally { Binder.restoreCallingIdentity(identity); if (registeredJustForThisCall) { magnificationController.unregister(); } } } private boolean registerMagnificationIfNeeded( MagnificationController magnificationController) { if (!magnificationController.isRegisteredLocked() && mSecurityPolicy.canControlMagnification(this)) { magnificationController.register(); return true; } return false; } @Override public boolean resetMagnification(boolean animate) { Loading services/core/java/com/android/server/wm/AccessibilityController.java +2 −0 Original line number Diff line number Diff line Loading @@ -429,6 +429,8 @@ final class AccessibilityController { } public void getMagnificationRegionLocked(Region outMagnificationRegion) { // Make sure we're working with the most current bounds mMagnifedViewport.recomputeBoundsLocked(); mMagnifedViewport.getMagnificationRegionLocked(outMagnificationRegion); } Loading Loading
services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +54 −18 Original line number Diff line number Diff line Loading @@ -2397,6 +2397,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { public static final int MSG_SEND_RELEVANT_EVENTS_CHANGED_TO_CLIENTS = 12; public static final int MSG_SEND_ACCESSIBILITY_BUTTON_TO_INPUT_FILTER = 13; public static final int MSG_SHOW_ACCESSIBILITY_BUTTON_CHOOSER = 14; public static final int MSG_INIT_SERVICE = 15; public MainHandler(Looper looper) { super(looper); Loading Loading @@ -2495,6 +2496,11 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { case MSG_SHOW_ACCESSIBILITY_BUTTON_CHOOSER: { showAccessibilityButtonTargetSelection(); } break; case MSG_INIT_SERVICE: { final Service service = (Service) msg.obj; service.initializeService(); } break; } } Loading Loading @@ -2950,20 +2956,31 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { if (userState.mBindingServices.contains(mComponentName) || mWasConnectedAndDied) { userState.mBindingServices.remove(mComponentName); mWasConnectedAndDied = false; try { mServiceInterface.init(this, mId, mOverlayWindowToken); onUserStateChangedLocked(userState); } catch (RemoteException re) { Slog.w(LOG_TAG, "Error while setting connection for service: " + service, re); binderDied(); } // Initialize the service on the main handler after we're done setting up for // the new configuration (for example, initializing the input filter). mMainHandler.obtainMessage(MainHandler.MSG_INIT_SERVICE, this).sendToTarget(); } else { binderDied(); } } } private void initializeService() { final IAccessibilityServiceClient serviceInterface; synchronized (mLock) { serviceInterface = mServiceInterface; } if (serviceInterface == null) return; try { serviceInterface.init(this, mId, mOverlayWindowToken); } catch (RemoteException re) { Slog.w(LOG_TAG, "Error while setting connection for service: " + serviceInterface, re); binderDied(); } } private boolean isCalledForCurrentUserLocked() { // We treat calls from a profile as if made by its parent as profiles // share the accessibility state of the parent. The call below Loading Loading @@ -3456,18 +3473,15 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return region; } MagnificationController magnificationController = getMagnificationController(); boolean forceRegistration = mSecurityPolicy.canControlMagnification(this); boolean initiallyRegistered = magnificationController.isRegisteredLocked(); if (!initiallyRegistered && forceRegistration) { magnificationController.register(); } boolean registeredJustForThisCall = registerMagnificationIfNeeded(magnificationController); final long identity = Binder.clearCallingIdentity(); try { magnificationController.getMagnificationRegion(region); return region; } finally { Binder.restoreCallingIdentity(identity); if (!initiallyRegistered && forceRegistration) { if (registeredJustForThisCall) { magnificationController.unregister(); } } Loading @@ -3481,11 +3495,17 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return 0.0f; } } MagnificationController magnificationController = getMagnificationController(); boolean registeredJustForThisCall = registerMagnificationIfNeeded(magnificationController); final long identity = Binder.clearCallingIdentity(); try { return getMagnificationController().getCenterX(); return magnificationController.getCenterX(); } finally { Binder.restoreCallingIdentity(identity); if (registeredJustForThisCall) { magnificationController.unregister(); } } } Loading @@ -3496,13 +3516,29 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return 0.0f; } } MagnificationController magnificationController = getMagnificationController(); boolean registeredJustForThisCall = registerMagnificationIfNeeded(magnificationController); final long identity = Binder.clearCallingIdentity(); try { return getMagnificationController().getCenterY(); return magnificationController.getCenterY(); } finally { Binder.restoreCallingIdentity(identity); if (registeredJustForThisCall) { magnificationController.unregister(); } } } private boolean registerMagnificationIfNeeded( MagnificationController magnificationController) { if (!magnificationController.isRegisteredLocked() && mSecurityPolicy.canControlMagnification(this)) { magnificationController.register(); return true; } return false; } @Override public boolean resetMagnification(boolean animate) { Loading
services/core/java/com/android/server/wm/AccessibilityController.java +2 −0 Original line number Diff line number Diff line Loading @@ -429,6 +429,8 @@ final class AccessibilityController { } public void getMagnificationRegionLocked(Region outMagnificationRegion) { // Make sure we're working with the most current bounds mMagnifedViewport.recomputeBoundsLocked(); mMagnifedViewport.getMagnificationRegionLocked(outMagnificationRegion); } Loading