diff options
author | Allen Hair <allenhair@google.com> | 2013-11-14 14:17:55 -0800 |
---|---|---|
committer | Allen Hair <allenhair@google.com> | 2013-11-14 14:17:55 -0800 |
commit | b2e353eca3f1309c506bf4ae3cc2bb271f4f7e17 (patch) | |
tree | 2a2fa8b8677bb21fac4bcdf1b3fbe8bcdc384422 | |
parent | a006b2db00f06a372cb141405f9b47484ea368b6 (diff) | |
download | uiautomator-b2e353eca3f1309c506bf4ae3cc2bb271f4f7e17.tar.gz |
Removed unnecessary synchronized block in findAccessibilityNodeInfo(..)
This fixes a deadlock that occurs when performing uiautomation against
an app targeted by instrumentation.
Change-Id: I113bbf3a3e7836ebb44c5b4e64e2db7edcecfc80
-rw-r--r-- | src/com/android/uiautomator/core/QueryController.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/com/android/uiautomator/core/QueryController.java b/src/com/android/uiautomator/core/QueryController.java index 6931528..194af4c 100644 --- a/src/com/android/uiautomator/core/QueryController.java +++ b/src/com/android/uiautomator/core/QueryController.java @@ -146,17 +146,15 @@ class QueryController { if (DEBUG) Log.d(LOG_TAG, "Searching: " + selector); - synchronized (mLock) { - AccessibilityNodeInfo rootNode = getRootNode(); - if (rootNode == null) { - Log.e(LOG_TAG, "Cannot proceed when root node is null. Aborted search"); - return null; - } - - // Copy so that we don't modify the original's sub selectors - UiSelector uiSelector = new UiSelector(selector); - return translateCompoundSelector(uiSelector, rootNode, isCounting); + AccessibilityNodeInfo rootNode = getRootNode(); + if (rootNode == null) { + Log.e(LOG_TAG, "Cannot proceed when root node is null. Aborted search"); + return null; } + + // Copy so that we don't modify the original's sub selectors + UiSelector uiSelector = new UiSelector(selector); + return translateCompoundSelector(uiSelector, rootNode, isCounting); } /** |