From 5164fed06287662968a0273a62c855f2bc3feee2 Mon Sep 17 00:00:00 2001 From: Taran Singh Date: Wed, 9 Nov 2022 21:09:51 +0000 Subject: [PATCH] Make HandwritingGesture methods final Make getGestureType() & getFallbackText() final since we don't expect these methods to be overriden by concrete gestures. This shouldn't cause any user observable behavior change. Bug: 256016481 Test: atest CtsInputMethodTestCases Change-Id: I865bed67089b06a572f5f085cbe04d0538928cb3 --- core/api/current.txt | 2 +- core/api/test-current.txt | 2 +- core/java/android/view/inputmethod/HandwritingGesture.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt index 623f210b83268..3d0efa8c047e8 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -54019,7 +54019,7 @@ package android.view.inputmethod { } public abstract class HandwritingGesture { - method @Nullable public String getFallbackText(); + method @Nullable public final String getFallbackText(); field public static final int GESTURE_TYPE_DELETE = 4; // 0x4 field public static final int GESTURE_TYPE_DELETE_RANGE = 64; // 0x40 field public static final int GESTURE_TYPE_INSERT = 2; // 0x2 diff --git a/core/api/test-current.txt b/core/api/test-current.txt index 0bbae8277b8a7..1701cc0dcf2d9 100644 --- a/core/api/test-current.txt +++ b/core/api/test-current.txt @@ -3181,7 +3181,7 @@ package android.view.displayhash { package android.view.inputmethod { public abstract class HandwritingGesture { - method public int getGestureType(); + method public final int getGestureType(); } public final class InlineSuggestion implements android.os.Parcelable { diff --git a/core/java/android/view/inputmethod/HandwritingGesture.java b/core/java/android/view/inputmethod/HandwritingGesture.java index 07b1e1f0468eb..251626941eeef 100644 --- a/core/java/android/view/inputmethod/HandwritingGesture.java +++ b/core/java/android/view/inputmethod/HandwritingGesture.java @@ -159,7 +159,7 @@ public abstract class HandwritingGesture { * @hide */ @TestApi - public @GestureType int getGestureType() { + public final @GestureType int getGestureType() { return mType; } @@ -173,7 +173,7 @@ public abstract class HandwritingGesture { * example 2: join can fail if the gesture is drawn over text but there is no whitespace. */ @Nullable - public String getFallbackText() { + public final String getFallbackText() { return mFallbackText; } }