summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-08-17 13:04:40 -0700
committerSunny Goyal <sunnygoyal@google.com>2015-08-17 13:04:40 -0700
commit522142af51fed5d23492c00bc8a37ec0cca8fdcc (patch)
tree34d04458d431f09d1bc90173899db67b02fda957 /src
parentb62a976346e1e9165bf3ab1c32e694caa0874dd2 (diff)
downloadandroid_packages_apps_Trebuchet-522142af51fed5d23492c00bc8a37ec0cca8fdcc.tar.gz
android_packages_apps_Trebuchet-522142af51fed5d23492c00bc8a37ec0cca8fdcc.tar.bz2
android_packages_apps_Trebuchet-522142af51fed5d23492c00bc8a37ec0cca8fdcc.zip
Removing call to isButtonPressed as its only Lollipop and above
Change-Id: I0d70befa25baf4864303833111652dbf1d19daa5
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/StylusEventHelper.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/com/android/launcher3/StylusEventHelper.java b/src/com/android/launcher3/StylusEventHelper.java
index da46e6a54..e03273a6e 100644
--- a/src/com/android/launcher3/StylusEventHelper.java
+++ b/src/com/android/launcher3/StylusEventHelper.java
@@ -1,8 +1,5 @@
package com.android.launcher3;
-import com.android.launcher3.Utilities;
-
-import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
@@ -77,8 +74,9 @@ public class StylusEventHelper {
* @param event The event to check.
* @return Whether a stylus button press occurred.
*/
- public static boolean isStylusButtonPressed(MotionEvent event) {
+ private static boolean isStylusButtonPressed(MotionEvent event) {
return event.getToolType(0) == MotionEvent.TOOL_TYPE_STYLUS
- && event.isButtonPressed(MotionEvent.BUTTON_SECONDARY);
+ && ((event.getButtonState() & MotionEvent.BUTTON_SECONDARY)
+ == MotionEvent.BUTTON_SECONDARY);
}
} \ No newline at end of file