Merge "Changes based on API council feedback for performContextClick" into nyc-dev
diff --git a/api/current.txt b/api/current.txt
index 10f3284..ef3c5e1 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -42503,6 +42503,7 @@
     method protected boolean overScrollBy(int, int, int, int, int, int, int, int, boolean);
     method public boolean performAccessibilityAction(int, android.os.Bundle);
     method public boolean performClick();
+    method public boolean performContextClick(float, float);
     method public boolean performContextClick();
     method public boolean performHapticFeedback(int);
     method public boolean performHapticFeedback(int, int);
diff --git a/api/system-current.txt b/api/system-current.txt
index 1d49652..d053103 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -45501,6 +45501,7 @@
     method protected boolean overScrollBy(int, int, int, int, int, int, int, int, boolean);
     method public boolean performAccessibilityAction(int, android.os.Bundle);
     method public boolean performClick();
+    method public boolean performContextClick(float, float);
     method public boolean performContextClick();
     method public boolean performHapticFeedback(int);
     method public boolean performHapticFeedback(int, int);
diff --git a/api/test-current.txt b/api/test-current.txt
index fea382f..4ade3d6 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -42582,6 +42582,7 @@
     method protected boolean overScrollBy(int, int, int, int, int, int, int, int, boolean);
     method public boolean performAccessibilityAction(int, android.os.Bundle);
     method public boolean performClick();
+    method public boolean performContextClick(float, float);
     method public boolean performContextClick();
     method public boolean performHapticFeedback(int);
     method public boolean performHapticFeedback(int, int);
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 2269282..f1f4964 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -5698,6 +5698,18 @@
     /**
      * Call this view's OnContextClickListener, if it is defined.
      *
+     * @param x the x coordinate of the context click
+     * @param y the y coordinate of the context click
+     * @return True if there was an assigned OnContextClickListener that consumed the event, false
+     *         otherwise.
+     */
+    public boolean performContextClick(float x, float y) {
+        return performContextClick();
+    }
+
+    /**
+     * Call this view's OnContextClickListener, if it is defined.
+     *
      * @return True if there was an assigned OnContextClickListener that consumed the event, false
      *         otherwise.
      */
@@ -10044,7 +10056,7 @@
                 if (isContextClickable() && !mInContextButtonPress && !mHasPerformedLongPress
                         && (actionButton == MotionEvent.BUTTON_STYLUS_PRIMARY
                         || actionButton == MotionEvent.BUTTON_SECONDARY)) {
-                    if (performContextClick()) {
+                    if (performContextClick(event.getX(), event.getY())) {
                         mInContextButtonPress = true;
                         setPressed(true, event.getX(), event.getY());
                         removeTapCallback();