title: Android: Can getRootInActiveWindow in an Accessibility Service cause ANRs?
body: <p>In my application I have an accessibility service that gets the root of the active window before performing further actions. The relevant section looks like this:</p>
  
  <pre><code>    @Override
      public final void onAccessibilityEvent(AccessibilityEvent event) {
      ...
      AccessibilityNodeInfo rootAccessibilityNode = getRootInActiveWindow();
      ...
      }
  </code></pre>
  
  <p>I'm getting complaints from users about ANRs, and the stacktrace is pointing me towards the getRootInActiveWindow line.</p>
  
  <p>Is it possible that getRootInActiveWindow causes ANRs and if so, what is the mechanism? Does this method need to be called in it's own thread? There's nothing in the documentation about this.</p>