Accessibility services cannot obtain the source of an event coming from a root namespace descendant.

1. The user can touch the screen at an arbitrary location potentially crossing the root namespace
   bounday which will send an accessibility event to accessibility services and they should be able
   to obtain the event source. Also accessibility ids are guaranteed to be unique in the window.
   Added a package scoped findViewByAccessibilityId method that dives into nested root namespaces.

2. Added accessibility support to the AnalogClock.

bug:5405934

Change-Id: I84edcb554bae41aafcbbc2723c5e62c1ef8a6ddf
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index d193d6e..31740ef 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -12093,6 +12093,39 @@
     }
 
     /**
+     * Finds a view by its unuque and stable accessibility id.
+     *
+     * @param accessibilityId The searched accessibility id.
+     * @return The found view.
+     */
+    final View findViewByAccessibilityId(int accessibilityId) {
+        if (accessibilityId < 0) {
+            return null;
+        }
+        return findViewByAccessibilityIdTraversal(accessibilityId);
+    }
+
+    /**
+     * Performs the traversal to find a view by its unuque and stable accessibility id.
+     *
+     * <strong>Note:</strong>This method does not stop at the root namespace
+     * boundary since the user can touch the screen at an arbitrary location
+     * potentially crossing the root namespace bounday which will send an
+     * accessibility event to accessibility services and they should be able
+     * to obtain the event source. Also accessibility ids are guaranteed to be
+     * unique in the window.
+     *
+     * @param accessibilityId The accessibility id.
+     * @return The found view.
+     */
+    View findViewByAccessibilityIdTraversal(int accessibilityId) {
+        if (getAccessibilityViewId() == accessibilityId) {
+            return this;
+        }
+        return null;
+    }
+
+    /**
      * Look for a child view with the given tag.  If this view has the given
      * tag, return this view.
      *