Loading core/java/android/view/AccessibilityInteractionController.java +46 −5 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.view; import android.graphics.Point; import android.graphics.Rect; import android.graphics.Region; import android.os.Binder; import android.os.Bundle; import android.os.Handler; import android.os.Looper; Loading Loading @@ -158,7 +159,9 @@ final class AccessibilityInteractionController { try { mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0; applyAppScaleAndMagnificationSpecIfNeeded(infos, spec); if (spec != null) { // Recycle if called from another process. Specs are cached in the // system process and obtained from a pool when read from parcel. if (spec != null && android.os.Process.myPid() != Binder.getCallingPid()) { spec.recycle(); } adjustIsVisibleToUserIfNeeded(infos, interactiveRegion); Loading @@ -167,6 +170,12 @@ final class AccessibilityInteractionController { } catch (RemoteException re) { /* ignore - the other side will time out */ } // Recycle if called from the same process. Regions are obtained in // the system process and instantiated when read from parcel. if (interactiveRegion != null && android.os.Process.myPid() == Binder.getCallingPid()) { interactiveRegion.recycle(); } } } Loading Loading @@ -244,7 +253,9 @@ final class AccessibilityInteractionController { try { mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0; applyAppScaleAndMagnificationSpecIfNeeded(infos, spec); if (spec != null) { // Recycle if called from another process. Specs are cached in the // system process and obtained from a pool when read from parcel. if (spec != null && android.os.Process.myPid() != Binder.getCallingPid()) { spec.recycle(); } adjustIsVisibleToUserIfNeeded(infos, interactiveRegion); Loading @@ -252,6 +263,12 @@ final class AccessibilityInteractionController { } catch (RemoteException re) { /* ignore - the other side will time out */ } // Recycle if called from the same process. Regions are obtained in // the system process and instantiated when read from parcel. if (interactiveRegion != null && android.os.Process.myPid() == Binder.getCallingPid()) { interactiveRegion.recycle(); } } } Loading Loading @@ -354,7 +371,9 @@ final class AccessibilityInteractionController { try { mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0; applyAppScaleAndMagnificationSpecIfNeeded(infos, spec); if (spec != null) { // Recycle if called from another process. Specs are cached in the // system process and obtained from a pool when read from parcel. if (spec != null && android.os.Process.myPid() != Binder.getCallingPid()) { spec.recycle(); } adjustIsVisibleToUserIfNeeded(infos, interactiveRegion); Loading @@ -362,6 +381,12 @@ final class AccessibilityInteractionController { } catch (RemoteException re) { /* ignore - the other side will time out */ } // Recycle if called from the same process. Regions are obtained in // the system process and instantiated when read from parcel. if (interactiveRegion != null && android.os.Process.myPid() == Binder.getCallingPid()) { interactiveRegion.recycle(); } } } Loading Loading @@ -468,7 +493,9 @@ final class AccessibilityInteractionController { try { mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0; applyAppScaleAndMagnificationSpecIfNeeded(focused, spec); if (spec != null) { // Recycle if called from another process. Specs are cached in the // system process and obtained from a pool when read from parcel. if (spec != null && android.os.Process.myPid() != Binder.getCallingPid()) { spec.recycle(); } adjustIsVisibleToUserIfNeeded(focused, interactiveRegion); Loading @@ -476,6 +503,12 @@ final class AccessibilityInteractionController { } catch (RemoteException re) { /* ignore - the other side will time out */ } // Recycle if called from the same process. Regions are obtained in // the system process and instantiated when read from parcel. if (interactiveRegion != null && android.os.Process.myPid() == Binder.getCallingPid()) { interactiveRegion.recycle(); } } } Loading Loading @@ -545,7 +578,9 @@ final class AccessibilityInteractionController { try { mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0; applyAppScaleAndMagnificationSpecIfNeeded(next, spec); if (spec != null) { // Recycle if called from another process. Specs are cached in the // system process and obtained from a pool when read from parcel. if (spec != null && android.os.Process.myPid() != Binder.getCallingPid()) { spec.recycle(); } adjustIsVisibleToUserIfNeeded(next, interactiveRegion); Loading @@ -553,6 +588,12 @@ final class AccessibilityInteractionController { } catch (RemoteException re) { /* ignore - the other side will time out */ } // Recycle if called from the same process. Regions are obtained in // the system process and instantiated when read from parcel. if (interactiveRegion != null && android.os.Process.myPid() == Binder.getCallingPid()) { interactiveRegion.recycle(); } } } Loading services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +30 −7 Original line number Diff line number Diff line Loading @@ -166,8 +166,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { private final List<AccessibilityServiceInfo> mEnabledServicesForFeedbackTempList = new ArrayList<>(); private final Region mTempRegion = new Region(); private final Rect mTempRect = new Rect(); private final Rect mTempRect1 = new Rect(); Loading Loading @@ -2241,7 +2239,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { throws RemoteException { final int resolvedWindowId; IAccessibilityInteractionConnection connection = null; Region partialInteractiveRegion = mTempRegion; Region partialInteractiveRegion = Region.obtain(); synchronized (mLock) { // 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 @@ -2265,6 +2263,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } if (!mSecurityPolicy.computePartialInteractiveRegionForWindowLocked( resolvedWindowId, partialInteractiveRegion)) { partialInteractiveRegion.recycle(); partialInteractiveRegion = null; } } Loading @@ -2282,6 +2281,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } } finally { Binder.restoreCallingIdentity(identityToken); // Recycle if passed to another process. if (partialInteractiveRegion != null && Binder.isProxy(connection)) { partialInteractiveRegion.recycle(); } } return false; } Loading @@ -2293,7 +2296,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { throws RemoteException { final int resolvedWindowId; IAccessibilityInteractionConnection connection = null; Region partialInteractiveRegion = mTempRegion; Region partialInteractiveRegion = Region.obtain(); synchronized (mLock) { // 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 @@ -2317,6 +2320,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } if (!mSecurityPolicy.computePartialInteractiveRegionForWindowLocked( resolvedWindowId, partialInteractiveRegion)) { partialInteractiveRegion.recycle(); partialInteractiveRegion = null; } } Loading @@ -2334,6 +2338,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } } finally { Binder.restoreCallingIdentity(identityToken); // Recycle if passed to another process. if (partialInteractiveRegion != null && Binder.isProxy(connection)) { partialInteractiveRegion.recycle(); } } return false; } Loading @@ -2345,7 +2353,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { long interrogatingTid) throws RemoteException { final int resolvedWindowId; IAccessibilityInteractionConnection connection = null; Region partialInteractiveRegion = mTempRegion; Region partialInteractiveRegion = Region.obtain(); synchronized (mLock) { // 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 @@ -2369,6 +2377,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } if (!mSecurityPolicy.computePartialInteractiveRegionForWindowLocked( resolvedWindowId, partialInteractiveRegion)) { partialInteractiveRegion.recycle(); partialInteractiveRegion = null; } } Loading @@ -2386,6 +2395,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } } finally { Binder.restoreCallingIdentity(identityToken); // Recycle if passed to another process. if (partialInteractiveRegion != null && Binder.isProxy(connection)) { partialInteractiveRegion.recycle(); } } return false; } Loading @@ -2397,7 +2410,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { throws RemoteException { final int resolvedWindowId; IAccessibilityInteractionConnection connection = null; Region partialInteractiveRegion = mTempRegion; Region partialInteractiveRegion = Region.obtain(); synchronized (mLock) { // 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 @@ -2422,6 +2435,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } if (!mSecurityPolicy.computePartialInteractiveRegionForWindowLocked( resolvedWindowId, partialInteractiveRegion)) { partialInteractiveRegion.recycle(); partialInteractiveRegion = null; } } Loading @@ -2439,6 +2453,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } } finally { Binder.restoreCallingIdentity(identityToken); // Recycle if passed to another process. if (partialInteractiveRegion != null && Binder.isProxy(connection)) { partialInteractiveRegion.recycle(); } } return false; } Loading @@ -2450,7 +2468,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { throws RemoteException { final int resolvedWindowId; IAccessibilityInteractionConnection connection = null; Region partialInteractiveRegion = mTempRegion; Region partialInteractiveRegion = Region.obtain(); synchronized (mLock) { // 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 @@ -2474,6 +2492,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } if (!mSecurityPolicy.computePartialInteractiveRegionForWindowLocked( resolvedWindowId, partialInteractiveRegion)) { partialInteractiveRegion.recycle(); partialInteractiveRegion = null; } } Loading @@ -2491,6 +2510,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } } finally { Binder.restoreCallingIdentity(identityToken); // Recycle if passed to another process. if (partialInteractiveRegion != null && Binder.isProxy(connection)) { partialInteractiveRegion.recycle(); } } return false; } Loading Loading
core/java/android/view/AccessibilityInteractionController.java +46 −5 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.view; import android.graphics.Point; import android.graphics.Rect; import android.graphics.Region; import android.os.Binder; import android.os.Bundle; import android.os.Handler; import android.os.Looper; Loading Loading @@ -158,7 +159,9 @@ final class AccessibilityInteractionController { try { mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0; applyAppScaleAndMagnificationSpecIfNeeded(infos, spec); if (spec != null) { // Recycle if called from another process. Specs are cached in the // system process and obtained from a pool when read from parcel. if (spec != null && android.os.Process.myPid() != Binder.getCallingPid()) { spec.recycle(); } adjustIsVisibleToUserIfNeeded(infos, interactiveRegion); Loading @@ -167,6 +170,12 @@ final class AccessibilityInteractionController { } catch (RemoteException re) { /* ignore - the other side will time out */ } // Recycle if called from the same process. Regions are obtained in // the system process and instantiated when read from parcel. if (interactiveRegion != null && android.os.Process.myPid() == Binder.getCallingPid()) { interactiveRegion.recycle(); } } } Loading Loading @@ -244,7 +253,9 @@ final class AccessibilityInteractionController { try { mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0; applyAppScaleAndMagnificationSpecIfNeeded(infos, spec); if (spec != null) { // Recycle if called from another process. Specs are cached in the // system process and obtained from a pool when read from parcel. if (spec != null && android.os.Process.myPid() != Binder.getCallingPid()) { spec.recycle(); } adjustIsVisibleToUserIfNeeded(infos, interactiveRegion); Loading @@ -252,6 +263,12 @@ final class AccessibilityInteractionController { } catch (RemoteException re) { /* ignore - the other side will time out */ } // Recycle if called from the same process. Regions are obtained in // the system process and instantiated when read from parcel. if (interactiveRegion != null && android.os.Process.myPid() == Binder.getCallingPid()) { interactiveRegion.recycle(); } } } Loading Loading @@ -354,7 +371,9 @@ final class AccessibilityInteractionController { try { mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0; applyAppScaleAndMagnificationSpecIfNeeded(infos, spec); if (spec != null) { // Recycle if called from another process. Specs are cached in the // system process and obtained from a pool when read from parcel. if (spec != null && android.os.Process.myPid() != Binder.getCallingPid()) { spec.recycle(); } adjustIsVisibleToUserIfNeeded(infos, interactiveRegion); Loading @@ -362,6 +381,12 @@ final class AccessibilityInteractionController { } catch (RemoteException re) { /* ignore - the other side will time out */ } // Recycle if called from the same process. Regions are obtained in // the system process and instantiated when read from parcel. if (interactiveRegion != null && android.os.Process.myPid() == Binder.getCallingPid()) { interactiveRegion.recycle(); } } } Loading Loading @@ -468,7 +493,9 @@ final class AccessibilityInteractionController { try { mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0; applyAppScaleAndMagnificationSpecIfNeeded(focused, spec); if (spec != null) { // Recycle if called from another process. Specs are cached in the // system process and obtained from a pool when read from parcel. if (spec != null && android.os.Process.myPid() != Binder.getCallingPid()) { spec.recycle(); } adjustIsVisibleToUserIfNeeded(focused, interactiveRegion); Loading @@ -476,6 +503,12 @@ final class AccessibilityInteractionController { } catch (RemoteException re) { /* ignore - the other side will time out */ } // Recycle if called from the same process. Regions are obtained in // the system process and instantiated when read from parcel. if (interactiveRegion != null && android.os.Process.myPid() == Binder.getCallingPid()) { interactiveRegion.recycle(); } } } Loading Loading @@ -545,7 +578,9 @@ final class AccessibilityInteractionController { try { mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0; applyAppScaleAndMagnificationSpecIfNeeded(next, spec); if (spec != null) { // Recycle if called from another process. Specs are cached in the // system process and obtained from a pool when read from parcel. if (spec != null && android.os.Process.myPid() != Binder.getCallingPid()) { spec.recycle(); } adjustIsVisibleToUserIfNeeded(next, interactiveRegion); Loading @@ -553,6 +588,12 @@ final class AccessibilityInteractionController { } catch (RemoteException re) { /* ignore - the other side will time out */ } // Recycle if called from the same process. Regions are obtained in // the system process and instantiated when read from parcel. if (interactiveRegion != null && android.os.Process.myPid() == Binder.getCallingPid()) { interactiveRegion.recycle(); } } } Loading
services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +30 −7 Original line number Diff line number Diff line Loading @@ -166,8 +166,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { private final List<AccessibilityServiceInfo> mEnabledServicesForFeedbackTempList = new ArrayList<>(); private final Region mTempRegion = new Region(); private final Rect mTempRect = new Rect(); private final Rect mTempRect1 = new Rect(); Loading Loading @@ -2241,7 +2239,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { throws RemoteException { final int resolvedWindowId; IAccessibilityInteractionConnection connection = null; Region partialInteractiveRegion = mTempRegion; Region partialInteractiveRegion = Region.obtain(); synchronized (mLock) { // 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 @@ -2265,6 +2263,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } if (!mSecurityPolicy.computePartialInteractiveRegionForWindowLocked( resolvedWindowId, partialInteractiveRegion)) { partialInteractiveRegion.recycle(); partialInteractiveRegion = null; } } Loading @@ -2282,6 +2281,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } } finally { Binder.restoreCallingIdentity(identityToken); // Recycle if passed to another process. if (partialInteractiveRegion != null && Binder.isProxy(connection)) { partialInteractiveRegion.recycle(); } } return false; } Loading @@ -2293,7 +2296,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { throws RemoteException { final int resolvedWindowId; IAccessibilityInteractionConnection connection = null; Region partialInteractiveRegion = mTempRegion; Region partialInteractiveRegion = Region.obtain(); synchronized (mLock) { // 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 @@ -2317,6 +2320,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } if (!mSecurityPolicy.computePartialInteractiveRegionForWindowLocked( resolvedWindowId, partialInteractiveRegion)) { partialInteractiveRegion.recycle(); partialInteractiveRegion = null; } } Loading @@ -2334,6 +2338,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } } finally { Binder.restoreCallingIdentity(identityToken); // Recycle if passed to another process. if (partialInteractiveRegion != null && Binder.isProxy(connection)) { partialInteractiveRegion.recycle(); } } return false; } Loading @@ -2345,7 +2353,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { long interrogatingTid) throws RemoteException { final int resolvedWindowId; IAccessibilityInteractionConnection connection = null; Region partialInteractiveRegion = mTempRegion; Region partialInteractiveRegion = Region.obtain(); synchronized (mLock) { // 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 @@ -2369,6 +2377,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } if (!mSecurityPolicy.computePartialInteractiveRegionForWindowLocked( resolvedWindowId, partialInteractiveRegion)) { partialInteractiveRegion.recycle(); partialInteractiveRegion = null; } } Loading @@ -2386,6 +2395,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } } finally { Binder.restoreCallingIdentity(identityToken); // Recycle if passed to another process. if (partialInteractiveRegion != null && Binder.isProxy(connection)) { partialInteractiveRegion.recycle(); } } return false; } Loading @@ -2397,7 +2410,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { throws RemoteException { final int resolvedWindowId; IAccessibilityInteractionConnection connection = null; Region partialInteractiveRegion = mTempRegion; Region partialInteractiveRegion = Region.obtain(); synchronized (mLock) { // 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 @@ -2422,6 +2435,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } if (!mSecurityPolicy.computePartialInteractiveRegionForWindowLocked( resolvedWindowId, partialInteractiveRegion)) { partialInteractiveRegion.recycle(); partialInteractiveRegion = null; } } Loading @@ -2439,6 +2453,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } } finally { Binder.restoreCallingIdentity(identityToken); // Recycle if passed to another process. if (partialInteractiveRegion != null && Binder.isProxy(connection)) { partialInteractiveRegion.recycle(); } } return false; } Loading @@ -2450,7 +2468,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { throws RemoteException { final int resolvedWindowId; IAccessibilityInteractionConnection connection = null; Region partialInteractiveRegion = mTempRegion; Region partialInteractiveRegion = Region.obtain(); synchronized (mLock) { // 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 @@ -2474,6 +2492,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } if (!mSecurityPolicy.computePartialInteractiveRegionForWindowLocked( resolvedWindowId, partialInteractiveRegion)) { partialInteractiveRegion.recycle(); partialInteractiveRegion = null; } } Loading @@ -2491,6 +2510,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } } finally { Binder.restoreCallingIdentity(identityToken); // Recycle if passed to another process. if (partialInteractiveRegion != null && Binder.isProxy(connection)) { partialInteractiveRegion.recycle(); } } return false; } Loading