OSDN Git Service

Removing call to isButtonPressed as its only Lollipop and above
authorSunny Goyal <sunnygoyal@google.com>
Mon, 17 Aug 2015 20:04:40 +0000 (13:04 -0700)
committerSunny Goyal <sunnygoyal@google.com>
Mon, 17 Aug 2015 20:04:40 +0000 (13:04 -0700)
Change-Id: I0d70befa25baf4864303833111652dbf1d19daa5

src/com/android/launcher3/StylusEventHelper.java

index da46e6a..e03273a 100644 (file)
@@ -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