From 6454c6d20b26f7cb2b1810888c4843a25c34cdbe Mon Sep 17 00:00:00 2001 From: Sandro Meier Date: Fri, 3 Mar 2023 16:41:39 +0000 Subject: [PATCH] Add action type to exception message for easier debugging The exception only mentioned that the action is not supported, but not what action was used. Test: N/A Bug: 271946580 Change-Id: Ib264172e794a912733572c9e72f3f2b526827845 --- core/java/android/hardware/input/VirtualTouchEvent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/hardware/input/VirtualTouchEvent.java b/core/java/android/hardware/input/VirtualTouchEvent.java index a2bb382e99508..5cfee8e560613 100644 --- a/core/java/android/hardware/input/VirtualTouchEvent.java +++ b/core/java/android/hardware/input/VirtualTouchEvent.java @@ -255,7 +255,8 @@ public final class VirtualTouchEvent implements Parcelable { public @NonNull Builder setAction(@Action int action) { if (action != ACTION_DOWN && action != ACTION_UP && action != ACTION_MOVE && action != ACTION_CANCEL) { - throw new IllegalArgumentException("Unsupported touch event action type"); + throw new IllegalArgumentException( + "Unsupported touch event action type: " + action); } mAction = action; return this;