Merge "Enter corresponding fragment by mouse primary key only" into main
diff --git a/Settings/src/com/android/tv/settings/SettingsPreferenceFragment.java b/Settings/src/com/android/tv/settings/SettingsPreferenceFragment.java
index 28a94ff..98e76a3 100644
--- a/Settings/src/com/android/tv/settings/SettingsPreferenceFragment.java
+++ b/Settings/src/com/android/tv/settings/SettingsPreferenceFragment.java
@@ -202,12 +202,14 @@
                             getContext(), R.animator.preference));
                 }
                 vh.itemView.setOnTouchListener((v, e) -> {
-                    if (e.getActionMasked() == MotionEvent.ACTION_DOWN) {
+                    if (e.getActionMasked() == MotionEvent.ACTION_DOWN
+                            && e.getButtonState() == MotionEvent.BUTTON_PRIMARY) {
                         vh.itemView.requestFocus();
                         v.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN,
                                 KeyEvent.KEYCODE_DPAD_CENTER));
                         return true;
-                    } else if (e.getActionMasked() == MotionEvent.ACTION_UP) {
+                    } else if (e.getActionMasked() == MotionEvent.ACTION_UP
+                            && e.getButtonState() == MotionEvent.BUTTON_PRIMARY) {
                         v.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP,
                                 KeyEvent.KEYCODE_DPAD_CENTER));
                         return true;