File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
core/java/android/accessibilityservice Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ public class UiTestAutomationBridge {
7474
7575 private volatile boolean mUnprocessedEventAvailable ;
7676
77+ private HandlerThread mHandlerThread ;
78+
7779 /**
7880 * Gets the last received {@link AccessibilityEvent}.
7981 *
@@ -126,9 +128,10 @@ public void connect() {
126128 // is needed for making sure the binder calls are interleaved
127129 // with check for the expected event and also to make sure the
128130 // binder threads are allowed to proceed in the received order.
129- HandlerThread handlerThread = new HandlerThread ("UiTestAutomationBridge" );
130- handlerThread .start ();
131- Looper looper = handlerThread .getLooper ();
131+ mHandlerThread = new HandlerThread ("UiTestAutomationBridge" );
132+ mHandlerThread .setDaemon (true );
133+ mHandlerThread .start ();
134+ Looper looper = mHandlerThread .getLooper ();
132135
133136 mListener = new IEventListenerWrapper (null , looper , new Callbacks () {
134137 @ Override
@@ -217,6 +220,8 @@ public void disconnect() {
217220 throw new IllegalStateException ("Already disconnected." );
218221 }
219222
223+ mHandlerThread .quit ();
224+
220225 IAccessibilityManager manager = IAccessibilityManager .Stub .asInterface (
221226 ServiceManager .getService (Context .ACCESSIBILITY_SERVICE ));
222227
You can’t perform that action at this time.
0 commit comments