Loading services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +0 −1 Original line number Diff line number Diff line Loading @@ -772,7 +772,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub public void unregisterUiTestAutomationService(IAccessibilityServiceClient serviceClient) { synchronized (mLock) { mUiAutomationManager.unregisterUiTestAutomationServiceLocked(serviceClient); onUserStateChangedLocked(getCurrentUserStateLocked()); } } Loading services/accessibility/java/com/android/server/accessibility/UiAutomationManager.java +16 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.os.RemoteException; import android.util.Slog; import android.view.accessibility.AccessibilityEvent; import com.android.internal.util.DumpUtils; import com.android.server.wm.WindowManagerInternal; import java.io.FileDescriptor; Loading @@ -45,6 +46,8 @@ class UiAutomationManager { private AccessibilityServiceInfo mUiAutomationServiceInfo; private AccessibilityClientConnection.SystemSupport mSystemSupport; private int mUiAutomationFlags; private IBinder mUiAutomationServiceOwner; Loading Loading @@ -92,6 +95,7 @@ class UiAutomationManager { return; } mSystemSupport = systemSupport; mUiAutomationService = new UiAutomationService(context, accessibilityServiceInfo, id, mainHandler, lock, securityPolicy, systemSupport, windowManagerInternal, globalActionPerfomer); Loading Loading @@ -169,6 +173,7 @@ class UiAutomationManager { mUiAutomationServiceOwner.unlinkToDeath(mUiAutomationServiceOwnerDeathRecipient, 0); mUiAutomationServiceOwner = null; } mSystemSupport.onClientChange(false); } private class UiAutomationService extends AccessibilityClientConnection { Loading Loading @@ -224,6 +229,17 @@ class UiAutomationManager { return true; } @Override public void dump(FileDescriptor fd, final PrintWriter pw, String[] args) { if (!DumpUtils.checkDumpPermission(mContext, LOG_TAG, pw)) return; synchronized (mLock) { pw.append("Ui Automation[eventTypes=" + AccessibilityEvent.eventTypeToString(mEventTypes)); pw.append(", notificationTimeout=" + mNotificationTimeout); pw.append("]"); } } // Since this isn't really an accessibility service, several methods are just stubbed here. @Override public boolean setSoftKeyboardShowMode(int mode) { Loading services/tests/servicestests/src/com/android/server/accessibility/UiAutomationManagerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -153,13 +153,14 @@ public class UiAutomationManagerTest { } @Test public void uiAutomationBinderDiesBeforeConnecting_shouldNotCrash() throws Exception { public void uiAutomationBinderDiesBeforeConnecting_notifiesSystem() throws Exception { register(0); ArgumentCaptor<IBinder.DeathRecipient> captor = ArgumentCaptor.forClass( IBinder.DeathRecipient.class); verify(mMockOwner).linkToDeath(captor.capture(), anyInt()); captor.getValue().binderDied(); mMessageCapturingHandler.sendAllMessages(); verify(mMockSystemSupport).onClientChange(false); } private void register(int flags) { Loading Loading
services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +0 −1 Original line number Diff line number Diff line Loading @@ -772,7 +772,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub public void unregisterUiTestAutomationService(IAccessibilityServiceClient serviceClient) { synchronized (mLock) { mUiAutomationManager.unregisterUiTestAutomationServiceLocked(serviceClient); onUserStateChangedLocked(getCurrentUserStateLocked()); } } Loading
services/accessibility/java/com/android/server/accessibility/UiAutomationManager.java +16 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.os.RemoteException; import android.util.Slog; import android.view.accessibility.AccessibilityEvent; import com.android.internal.util.DumpUtils; import com.android.server.wm.WindowManagerInternal; import java.io.FileDescriptor; Loading @@ -45,6 +46,8 @@ class UiAutomationManager { private AccessibilityServiceInfo mUiAutomationServiceInfo; private AccessibilityClientConnection.SystemSupport mSystemSupport; private int mUiAutomationFlags; private IBinder mUiAutomationServiceOwner; Loading Loading @@ -92,6 +95,7 @@ class UiAutomationManager { return; } mSystemSupport = systemSupport; mUiAutomationService = new UiAutomationService(context, accessibilityServiceInfo, id, mainHandler, lock, securityPolicy, systemSupport, windowManagerInternal, globalActionPerfomer); Loading Loading @@ -169,6 +173,7 @@ class UiAutomationManager { mUiAutomationServiceOwner.unlinkToDeath(mUiAutomationServiceOwnerDeathRecipient, 0); mUiAutomationServiceOwner = null; } mSystemSupport.onClientChange(false); } private class UiAutomationService extends AccessibilityClientConnection { Loading Loading @@ -224,6 +229,17 @@ class UiAutomationManager { return true; } @Override public void dump(FileDescriptor fd, final PrintWriter pw, String[] args) { if (!DumpUtils.checkDumpPermission(mContext, LOG_TAG, pw)) return; synchronized (mLock) { pw.append("Ui Automation[eventTypes=" + AccessibilityEvent.eventTypeToString(mEventTypes)); pw.append(", notificationTimeout=" + mNotificationTimeout); pw.append("]"); } } // Since this isn't really an accessibility service, several methods are just stubbed here. @Override public boolean setSoftKeyboardShowMode(int mode) { Loading
services/tests/servicestests/src/com/android/server/accessibility/UiAutomationManagerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -153,13 +153,14 @@ public class UiAutomationManagerTest { } @Test public void uiAutomationBinderDiesBeforeConnecting_shouldNotCrash() throws Exception { public void uiAutomationBinderDiesBeforeConnecting_notifiesSystem() throws Exception { register(0); ArgumentCaptor<IBinder.DeathRecipient> captor = ArgumentCaptor.forClass( IBinder.DeathRecipient.class); verify(mMockOwner).linkToDeath(captor.capture(), anyInt()); captor.getValue().binderDied(); mMessageCapturingHandler.sendAllMessages(); verify(mMockSystemSupport).onClientChange(false); } private void register(int flags) { Loading