Don't exit touch mode when focusing FPV.
Make FocusParkingView not call ensureTouchMode(false) when handling
ACTION_FOCUS. The RotaryService performs this action to clear focus
when the user touches the screen so we don't want to exit touch mode.
Bug: 160920511
Test: manual
Change-Id: I56e0cbaa9620287c190330ca071ab309a193ac2a
diff --git a/car-ui-lib/src/com/android/car/ui/FocusParkingView.java b/car-ui-lib/src/com/android/car/ui/FocusParkingView.java
index 2167d23..761a764 100644
--- a/car-ui-lib/src/com/android/car/ui/FocusParkingView.java
+++ b/car-ui-lib/src/com/android/car/ui/FocusParkingView.java
@@ -17,6 +17,7 @@
import static android.view.accessibility.AccessibilityNodeInfo.ACTION_COLLAPSE;
import static android.view.accessibility.AccessibilityNodeInfo.ACTION_DISMISS;
+import static android.view.accessibility.AccessibilityNodeInfo.ACTION_FOCUS;
import android.content.Context;
import android.os.Bundle;
@@ -130,6 +131,12 @@
getContext().getSystemService(InputMethodManager.class);
return inputMethodManager.hideSoftInputFromWindow(getWindowToken(),
/* flags= */ 0);
+ case ACTION_FOCUS:
+ // Don't leave this to View to handle as it will exit touch mode.
+ if (!hasFocus()) {
+ return requestFocus();
+ }
+ break;
}
return super.performAccessibilityAction(action, arguments);
}