Change stylus button press to context click in View - API review feedback

Updates all references in View's onStylusButtonPress to onContextClick
as per API review feedback.

Additionally listens for mouse right clicks and calls the onContextClick
method for these as well for the stylus button press.

Bug: 21572278
Change-Id: I5c1ee8c8f23a77d7c677b86356e89d0e4fc40056
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 46793b9..a679358 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -288,8 +288,8 @@
     // Vibrator pattern for haptic feedback during boot when safe mode is enabled.
     long[] mSafeModeEnabledVibePattern;
 
-    // Vibrator pattern for haptic feedback of a stylus button press.
-    long[] mStylusButtonPressVibePattern;
+    // Vibrator pattern for haptic feedback of a context click.
+    long[] mContextClickVibePattern;
 
     /** If true, hitting shift & menu will broadcast Intent.ACTION_BUG_REPORT */
     boolean mEnableShiftMenuBugReports = false;
@@ -1453,8 +1453,8 @@
                 com.android.internal.R.array.config_safeModeDisabledVibePattern);
         mSafeModeEnabledVibePattern = getLongIntArray(mContext.getResources(),
                 com.android.internal.R.array.config_safeModeEnabledVibePattern);
-        mStylusButtonPressVibePattern = getLongIntArray(mContext.getResources(),
-                com.android.internal.R.array.config_stylusButtonPressVibePattern);
+        mContextClickVibePattern = getLongIntArray(mContext.getResources(),
+                com.android.internal.R.array.config_contextClickVibePattern);
 
         mScreenshotChordEnabled = mContext.getResources().getBoolean(
                 com.android.internal.R.bool.config_enableScreenshotChord);
@@ -6284,8 +6284,8 @@
             case HapticFeedbackConstants.SAFE_MODE_ENABLED:
                 pattern = mSafeModeEnabledVibePattern;
                 break;
-            case HapticFeedbackConstants.STYLUS_BUTTON_PRESS:
-                pattern = mStylusButtonPressVibePattern;
+            case HapticFeedbackConstants.CONTEXT_CLICK:
+                pattern = mContextClickVibePattern;
                 break;
             default:
                 return false;