Removing call to isButtonPressed as its only Lollipop and above

Change-Id: I0d70befa25baf4864303833111652dbf1d19daa5
This commit is contained in:
Sunny Goyal
2015-08-17 13:04:40 -07:00
parent b62a976346
commit 522142af51

View 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);
}
}