|
79 | 79 |
|
80 | 80 | import com.android.internal.R; |
81 | 81 | import com.android.internal.content.PackageMonitor; |
82 | | -import com.android.internal.os.SomeArgs; |
83 | 82 | import com.android.internal.statusbar.IStatusBarService; |
84 | 83 |
|
85 | 84 | import org.xmlpull.v1.XmlPullParserException; |
@@ -472,13 +471,18 @@ public void registerUiTestAutomationService(IAccessibilityServiceClient serviceC |
472 | 471 | // If necessary enable accessibility and announce that. |
473 | 472 | if (!userState.mIsAccessibilityEnabled) { |
474 | 473 | userState.mIsAccessibilityEnabled = true; |
475 | | - scheduleSendStateToClientsLocked(userState); |
476 | 474 | } |
| 475 | + // No touch exploration. |
| 476 | + userState.mIsTouchExplorationEnabled = false; |
| 477 | + |
| 478 | + // Hook the automation service up. |
| 479 | + mUiAutomationService = new Service(mCurrentUserId, componentName, |
| 480 | + accessibilityServiceInfo, true); |
| 481 | + mUiAutomationService.onServiceConnected(componentName, serviceClient.asBinder()); |
| 482 | + |
| 483 | + updateInputFilterLocked(userState); |
| 484 | + scheduleSendStateToClientsLocked(userState); |
477 | 485 | } |
478 | | - // Hook the automation service up. |
479 | | - mUiAutomationService = new Service(mCurrentUserId, componentName, |
480 | | - accessibilityServiceInfo, true); |
481 | | - mUiAutomationService.onServiceConnected(componentName, serviceClient.asBinder()); |
482 | 486 | } |
483 | 487 |
|
484 | 488 | public void unregisterUiTestAutomationService(IAccessibilityServiceClient serviceClient) { |
@@ -591,16 +595,6 @@ private void switchUser(int userId) { |
591 | 595 | // Recreate the internal state for the new user. |
592 | 596 | mMainHandler.obtainMessage(MainHandler.MSG_SEND_RECREATE_INTERNAL_STATE, |
593 | 597 | mCurrentUserId, 0).sendToTarget(); |
594 | | - |
595 | | - // Re-register the test automation service after the new state is recreated. |
596 | | - if (mUiAutomationService != null) { |
597 | | - unregisterUiTestAutomationService(mUiAutomationService.mServiceInterface); |
598 | | - SomeArgs args = SomeArgs.obtain(); |
599 | | - args.arg1 = mUiAutomationService.mServiceInterface; |
600 | | - args.arg2 = mUiAutomationService.mAccessibilityServiceInfo; |
601 | | - mMainHandler.obtainMessage(MainHandler.MSG_REGISTER_UI_TEST_AUTOMATION_SERVICE, |
602 | | - args).sendToTarget(); |
603 | | - } |
604 | 598 | } |
605 | 599 | } |
606 | 600 |
|
@@ -1166,7 +1160,6 @@ private final class MainHandler extends Handler { |
1166 | 1160 | public static final int MSG_SEND_STATE_TO_CLIENTS = 2; |
1167 | 1161 | public static final int MSG_SEND_CLEARED_STATE_TO_CLIENTS_FOR_USER = 3; |
1168 | 1162 | public static final int MSG_SEND_RECREATE_INTERNAL_STATE = 4; |
1169 | | - public static final int MSG_REGISTER_UI_TEST_AUTOMATION_SERVICE = 5; |
1170 | 1163 |
|
1171 | 1164 | public MainHandler(Looper looper) { |
1172 | 1165 | super(looper); |
@@ -1202,17 +1195,6 @@ public void handleMessage(Message msg) { |
1202 | 1195 | recreateInternalStateLocked(userState); |
1203 | 1196 | } |
1204 | 1197 | } break; |
1205 | | - case MSG_REGISTER_UI_TEST_AUTOMATION_SERVICE: { |
1206 | | - SomeArgs args = (SomeArgs) msg.obj; |
1207 | | - try { |
1208 | | - IAccessibilityServiceClient client = |
1209 | | - (IAccessibilityServiceClient) args.arg1; |
1210 | | - AccessibilityServiceInfo info = (AccessibilityServiceInfo) args.arg2; |
1211 | | - registerUiTestAutomationService(client, info); |
1212 | | - } finally { |
1213 | | - args.recycle(); |
1214 | | - } |
1215 | | - } break; |
1216 | 1198 | } |
1217 | 1199 | } |
1218 | 1200 |
|
|
0 commit comments