Loading core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -56907,6 +56907,7 @@ package android.view.inputmethod { ctor public EditorInfo(); method public int describeContents(); method public void dump(android.util.Printer, String); method @FlaggedApi("android.view.inputmethod.public_autofill_id_in_editorinfo") @Nullable public android.view.autofill.AutofillId getAutofillId(); method @Nullable public CharSequence getInitialSelectedText(int); method @Nullable public android.view.inputmethod.SurroundingText getInitialSurroundingText(@IntRange(from=0) int, @IntRange(from=0) int, int); method @Nullable public CharSequence getInitialTextAfterCursor(@IntRange(from=0) int, int); Loading @@ -56916,6 +56917,7 @@ package android.view.inputmethod { method @NonNull public java.util.List<java.lang.Class<? extends android.view.inputmethod.HandwritingGesture>> getSupportedHandwritingGestures(); method @FlaggedApi("android.view.inputmethod.editorinfo_handwriting_enabled") public boolean isStylusHandwritingEnabled(); method public final void makeCompatible(int); method @FlaggedApi("android.view.inputmethod.public_autofill_id_in_editorinfo") public void setAutofillId(@Nullable android.view.autofill.AutofillId); method public void setInitialSurroundingSubText(@NonNull CharSequence, int); method public void setInitialSurroundingText(@NonNull CharSequence); method public void setInitialToolType(int); core/java/android/inputmethodservice/InputMethodService.java +1 −1 Original line number Diff line number Diff line Loading @@ -3436,7 +3436,7 @@ public class InputMethodService extends AbstractInputMethodService { initialize(); mInlineSuggestionSessionController.notifyOnStartInput( editorInfo == null ? null : editorInfo.packageName, editorInfo == null ? null : editorInfo.autofillId); editorInfo == null ? null : editorInfo.getAutofillId()); if (DEBUG) Log.v(TAG, "CALL: onStartInput"); onStartInput(editorInfo, restarting); if (mDecorViewVisible) { Loading core/java/android/view/inputmethod/EditorInfo.java +26 −5 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static android.view.inputmethod.EditorInfoProto.PACKAGE_NAME; import static android.view.inputmethod.EditorInfoProto.PRIVATE_IME_OPTIONS; import static android.view.inputmethod.EditorInfoProto.TARGET_INPUT_METHOD_USER_ID; import static android.view.inputmethod.Flags.FLAG_EDITORINFO_HANDWRITING_ENABLED; import static android.view.inputmethod.Flags.FLAG_PUBLIC_AUTOFILL_ID_IN_EDITORINFO; import android.annotation.FlaggedApi; import android.annotation.IntDef; Loading Loading @@ -470,12 +471,10 @@ public class EditorInfo implements InputType, Parcelable { public String packageName; /** * Autofill Id for the field that's currently on focus. * * <p> Marked as hide since it's only used by framework.</p> * @hide * Autofill Id for the field that's currently on focus. See link {@link AutofillId} for more * details. It is set by {@link View#getAutofillId()} */ public AutofillId autofillId; private AutofillId autofillId; /** * Identifier for the editor's field. This is optional, and may be Loading Loading @@ -1199,6 +1198,28 @@ public class EditorInfo implements InputType, Parcelable { mInitialToolType = toolType; } /** * Returns the {@link AutofillId} of the view that this {@link EditorInfo} is associated with. * The value is filled in with the result of {@link android.view.View#getAutofillId() * View.getAutofillId()} on the view that is being edited. * * Note: For virtual view(e.g. Compose or Webview), default behavior is the autofillId is the id * of the container view, unless the virtual view provider sets the virtual id when the * InputMethodManager calls {@link android.view.View#onCreateInputConnection()} on the container * view. */ @FlaggedApi(FLAG_PUBLIC_AUTOFILL_ID_IN_EDITORINFO) @Nullable public AutofillId getAutofillId() { return autofillId; } /** Sets the {@link AutofillId} of the view that this {@link EditorInfo} is associated with. */ @FlaggedApi(FLAG_PUBLIC_AUTOFILL_ID_IN_EDITORINFO) public void setAutofillId(@Nullable AutofillId autofillId) { this.autofillId = autofillId; } /** * Export the state of {@link EditorInfo} into a protocol buffer output stream. * Loading core/java/android/view/inputmethod/InputMethodManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -5179,7 +5179,7 @@ public final class InputMethodManager { // system can verify the consistency between the uid of this process and package name passed // from here. See comment of Context#getOpPackageName() for details. editorInfo.packageName = servedView.getContext().getOpPackageName(); editorInfo.autofillId = servedView.getAutofillId(); editorInfo.setAutofillId(servedView.getAutofillId()); editorInfo.fieldId = servedView.getId(); final InputConnection ic = servedView.onCreateInputConnection(editorInfo); if (DEBUG) Log.v(TAG, "Starting input: editorInfo=" + editorInfo + " ic=" + ic); Loading @@ -5188,7 +5188,7 @@ public final class InputMethodManager { // This ensures that even disconnected EditorInfos have well-defined attributes, // making them consistently and straightforwardly comparable. if (ic == null) { editorInfo.autofillId = AutofillId.NO_AUTOFILL_ID; editorInfo.setAutofillId(AutofillId.NO_AUTOFILL_ID); editorInfo.fieldId = 0; } return new Pair<>(ic, editorInfo); Loading core/java/android/view/inputmethod/flags.aconfig +10 −1 Original line number Diff line number Diff line Loading @@ -166,3 +166,12 @@ flag { bug: "373788889" is_fixed_read_only: true } flag { name: "public_autofill_id_in_editorinfo" is_exported: true namespace: "input_method" description: "Guarding public API autofillId in editor info" bug: "342672560" is_fixed_read_only: true } Loading
core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -56907,6 +56907,7 @@ package android.view.inputmethod { ctor public EditorInfo(); method public int describeContents(); method public void dump(android.util.Printer, String); method @FlaggedApi("android.view.inputmethod.public_autofill_id_in_editorinfo") @Nullable public android.view.autofill.AutofillId getAutofillId(); method @Nullable public CharSequence getInitialSelectedText(int); method @Nullable public android.view.inputmethod.SurroundingText getInitialSurroundingText(@IntRange(from=0) int, @IntRange(from=0) int, int); method @Nullable public CharSequence getInitialTextAfterCursor(@IntRange(from=0) int, int); Loading @@ -56916,6 +56917,7 @@ package android.view.inputmethod { method @NonNull public java.util.List<java.lang.Class<? extends android.view.inputmethod.HandwritingGesture>> getSupportedHandwritingGestures(); method @FlaggedApi("android.view.inputmethod.editorinfo_handwriting_enabled") public boolean isStylusHandwritingEnabled(); method public final void makeCompatible(int); method @FlaggedApi("android.view.inputmethod.public_autofill_id_in_editorinfo") public void setAutofillId(@Nullable android.view.autofill.AutofillId); method public void setInitialSurroundingSubText(@NonNull CharSequence, int); method public void setInitialSurroundingText(@NonNull CharSequence); method public void setInitialToolType(int);
core/java/android/inputmethodservice/InputMethodService.java +1 −1 Original line number Diff line number Diff line Loading @@ -3436,7 +3436,7 @@ public class InputMethodService extends AbstractInputMethodService { initialize(); mInlineSuggestionSessionController.notifyOnStartInput( editorInfo == null ? null : editorInfo.packageName, editorInfo == null ? null : editorInfo.autofillId); editorInfo == null ? null : editorInfo.getAutofillId()); if (DEBUG) Log.v(TAG, "CALL: onStartInput"); onStartInput(editorInfo, restarting); if (mDecorViewVisible) { Loading
core/java/android/view/inputmethod/EditorInfo.java +26 −5 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static android.view.inputmethod.EditorInfoProto.PACKAGE_NAME; import static android.view.inputmethod.EditorInfoProto.PRIVATE_IME_OPTIONS; import static android.view.inputmethod.EditorInfoProto.TARGET_INPUT_METHOD_USER_ID; import static android.view.inputmethod.Flags.FLAG_EDITORINFO_HANDWRITING_ENABLED; import static android.view.inputmethod.Flags.FLAG_PUBLIC_AUTOFILL_ID_IN_EDITORINFO; import android.annotation.FlaggedApi; import android.annotation.IntDef; Loading Loading @@ -470,12 +471,10 @@ public class EditorInfo implements InputType, Parcelable { public String packageName; /** * Autofill Id for the field that's currently on focus. * * <p> Marked as hide since it's only used by framework.</p> * @hide * Autofill Id for the field that's currently on focus. See link {@link AutofillId} for more * details. It is set by {@link View#getAutofillId()} */ public AutofillId autofillId; private AutofillId autofillId; /** * Identifier for the editor's field. This is optional, and may be Loading Loading @@ -1199,6 +1198,28 @@ public class EditorInfo implements InputType, Parcelable { mInitialToolType = toolType; } /** * Returns the {@link AutofillId} of the view that this {@link EditorInfo} is associated with. * The value is filled in with the result of {@link android.view.View#getAutofillId() * View.getAutofillId()} on the view that is being edited. * * Note: For virtual view(e.g. Compose or Webview), default behavior is the autofillId is the id * of the container view, unless the virtual view provider sets the virtual id when the * InputMethodManager calls {@link android.view.View#onCreateInputConnection()} on the container * view. */ @FlaggedApi(FLAG_PUBLIC_AUTOFILL_ID_IN_EDITORINFO) @Nullable public AutofillId getAutofillId() { return autofillId; } /** Sets the {@link AutofillId} of the view that this {@link EditorInfo} is associated with. */ @FlaggedApi(FLAG_PUBLIC_AUTOFILL_ID_IN_EDITORINFO) public void setAutofillId(@Nullable AutofillId autofillId) { this.autofillId = autofillId; } /** * Export the state of {@link EditorInfo} into a protocol buffer output stream. * Loading
core/java/android/view/inputmethod/InputMethodManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -5179,7 +5179,7 @@ public final class InputMethodManager { // system can verify the consistency between the uid of this process and package name passed // from here. See comment of Context#getOpPackageName() for details. editorInfo.packageName = servedView.getContext().getOpPackageName(); editorInfo.autofillId = servedView.getAutofillId(); editorInfo.setAutofillId(servedView.getAutofillId()); editorInfo.fieldId = servedView.getId(); final InputConnection ic = servedView.onCreateInputConnection(editorInfo); if (DEBUG) Log.v(TAG, "Starting input: editorInfo=" + editorInfo + " ic=" + ic); Loading @@ -5188,7 +5188,7 @@ public final class InputMethodManager { // This ensures that even disconnected EditorInfos have well-defined attributes, // making them consistently and straightforwardly comparable. if (ic == null) { editorInfo.autofillId = AutofillId.NO_AUTOFILL_ID; editorInfo.setAutofillId(AutofillId.NO_AUTOFILL_ID); editorInfo.fieldId = 0; } return new Pair<>(ic, editorInfo); Loading
core/java/android/view/inputmethod/flags.aconfig +10 −1 Original line number Diff line number Diff line Loading @@ -166,3 +166,12 @@ flag { bug: "373788889" is_fixed_read_only: true } flag { name: "public_autofill_id_in_editorinfo" is_exported: true namespace: "input_method" description: "Guarding public API autofillId in editor info" bug: "342672560" is_fixed_read_only: true }