Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4053b8f3 authored by Justin Ghan's avatar Justin Ghan Committed by Android (Google) Code Review
Browse files

Merge "Javadoc updates for connectionless handwriting APIs" into main

parents 4ad94b6a 02bfb2de
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -2796,6 +2796,9 @@ public class InputMethodService extends AbstractInputMethodService {
     * <p>This dismisses the {@link #getStylusHandwritingWindow ink window} and stops intercepting
     * <p>This dismisses the {@link #getStylusHandwritingWindow ink window} and stops intercepting
     * stylus {@code MotionEvent}s.
     * stylus {@code MotionEvent}s.
     *
     *
     * <p>Connectionless handwriting sessions should be finished using {@link
     * #finishConnectionlessStylusHandwriting(CharSequence)}.
     *
     * <p>Note for IME developers: Call this method at any time to finish the current handwriting
     * <p>Note for IME developers: Call this method at any time to finish the current handwriting
     * session. Generally, this should be invoked after a short timeout, giving the user enough time
     * session. Generally, this should be invoked after a short timeout, giving the user enough time
     * to start the next stylus stroke, if any. By default, system will time-out after few seconds.
     * to start the next stylus stroke, if any. By default, system will time-out after few seconds.
@@ -2803,9 +2806,6 @@ public class InputMethodService extends AbstractInputMethodService {
     *
     *
     * <p>Handwriting session will be finished by framework on next {@link #onFinishInput()}.
     * <p>Handwriting session will be finished by framework on next {@link #onFinishInput()}.
     */
     */
    // TODO(b/300979854): Once connectionless APIs are finalised, update documentation to add:
    // <p>Connectionless handwriting sessions should be finished using {@link
    // #finishConnectionlessStylusHandwriting(CharSequence)}.
    public final void finishStylusHandwriting() {
    public final void finishStylusHandwriting() {
        if (DEBUG) Log.v(TAG, "finishStylusHandwriting()");
        if (DEBUG) Log.v(TAG, "finishStylusHandwriting()");
        if (mInkWindow == null) {
        if (mInkWindow == null) {
+28 −22
Original line number Original line Diff line number Diff line
@@ -2887,6 +2887,11 @@ public final class InputMethodManager {
     * initiation delegation was previously requested using
     * initiation delegation was previously requested using
     * {@link #prepareStylusHandwritingDelegation(View)} from the delegator.
     * {@link #prepareStylusHandwritingDelegation(View)} from the delegator.
     *
     *
     * <p>Otherwise, if the delegator view previously started delegation using {@link
     * #startConnectionlessStylusHandwritingForDelegation(View, CursorAnchorInfo, Executor,
     * ConnectionlessHandwritingCallback)}, requests the IME to commit the recognised handwritten
     * text from the connectionless session to the delegate view.
     *
     * <p>Note: If delegator and delegate are in different application packages, use
     * <p>Note: If delegator and delegate are in different application packages, use
     * {@link #acceptStylusHandwritingDelegation(View, String)} instead.</p>
     * {@link #acceptStylusHandwritingDelegation(View, String)} instead.</p>
     *
     *
@@ -2895,14 +2900,9 @@ public final class InputMethodManager {
     *  {@link #prepareStylusHandwritingDelegation(View)} and delegation is accepted
     *  {@link #prepareStylusHandwritingDelegation(View)} and delegation is accepted
     * @see #prepareStylusHandwritingDelegation(View)
     * @see #prepareStylusHandwritingDelegation(View)
     * @see #acceptStylusHandwritingDelegation(View, String)
     * @see #acceptStylusHandwritingDelegation(View, String)
     * @see #startConnectionlessStylusHandwritingForDelegation(View, CursorAnchorInfo, Executor,
     *     ConnectionlessHandwritingCallback)
     */
     */
    // TODO(b/300979854): Once connectionless APIs are finalised, update documentation to add:
    // <p>Otherwise, if the delegator view previously started delegation using {@link
    // #startConnectionlessStylusHandwritingForDelegation(View, ResultReceiver, CursorAnchorInfo)},
    // requests the IME to commit the recognised handwritten text from the connectionless session to
    // the delegate view.
    // @see #startConnectionlessStylusHandwritingForDelegation(View, ResultReceiver,
    //     CursorAnchorInfo)
    public boolean acceptStylusHandwritingDelegation(@NonNull View delegateView) {
    public boolean acceptStylusHandwritingDelegation(@NonNull View delegateView) {
        return startStylusHandwritingInternal(
        return startStylusHandwritingInternal(
                delegateView, delegateView.getContext().getOpPackageName(),
                delegateView, delegateView.getContext().getOpPackageName(),
@@ -2915,6 +2915,11 @@ public final class InputMethodManager {
     * {@link #prepareStylusHandwritingDelegation(View, String)} from the delegator and the view
     * {@link #prepareStylusHandwritingDelegation(View, String)} from the delegator and the view
     * belongs to a specified delegate package.
     * belongs to a specified delegate package.
     *
     *
     * <p>Otherwise, if the delegator view previously started delegation using {@link
     * #startConnectionlessStylusHandwritingForDelegation(View, CursorAnchorInfo, String, Executor,
     * ConnectionlessHandwritingCallback)}, requests the IME to commit the recognised handwritten
     * text from the connectionless session to the delegate view.
     *
     * <p>Note: If delegator and delegate are in the same application package, use
     * <p>Note: If delegator and delegate are in the same application package, use
     * {@link #acceptStylusHandwritingDelegation(View)} instead.</p>
     * {@link #acceptStylusHandwritingDelegation(View)} instead.</p>
     *
     *
@@ -2924,15 +2929,10 @@ public final class InputMethodManager {
     *     #prepareStylusHandwritingDelegation(View, String)} and delegation is accepted
     *     #prepareStylusHandwritingDelegation(View, String)} and delegation is accepted
     * @see #prepareStylusHandwritingDelegation(View, String)
     * @see #prepareStylusHandwritingDelegation(View, String)
     * @see #acceptStylusHandwritingDelegation(View)
     * @see #acceptStylusHandwritingDelegation(View)
     * @see #startConnectionlessStylusHandwritingForDelegation(View, CursorAnchorInfo, String,
     *     Executor, ConnectionlessHandwritingCallback)
     * TODO (b/293640003): deprecate this method once flag is enabled.
     * TODO (b/293640003): deprecate this method once flag is enabled.
     */
     */
    // TODO(b/300979854): Once connectionless APIs are finalised, update documentation to add:
    // <p>Otherwise, if the delegator view previously started delegation using {@link
    // #startConnectionlessStylusHandwritingForDelegation(View, ResultReceiver, CursorAnchorInfo,
    // String)}, requests the IME to commit the recognised handwritten text from the connectionless
    // session to the delegate view.
    // @see #startConnectionlessStylusHandwritingForDelegation(View, ResultReceiver,
    //     CursorAnchorInfo, String)
    public boolean acceptStylusHandwritingDelegation(
    public boolean acceptStylusHandwritingDelegation(
            @NonNull View delegateView, @NonNull String delegatorPackageName) {
            @NonNull View delegateView, @NonNull String delegatorPackageName) {
        Objects.requireNonNull(delegatorPackageName);
        Objects.requireNonNull(delegatorPackageName);
@@ -2946,6 +2946,11 @@ public final class InputMethodManager {
     * {@link #prepareStylusHandwritingDelegation(View, String)} from the delegator and the view
     * {@link #prepareStylusHandwritingDelegation(View, String)} from the delegator and the view
     * belongs to a specified delegate package.
     * belongs to a specified delegate package.
     *
     *
     * <p>Otherwise, if the delegator view previously started delegation using {@link
     * #startConnectionlessStylusHandwritingForDelegation(View, CursorAnchorInfo, String, Executor,
     * ConnectionlessHandwritingCallback)}, requests the IME to commit the recognised handwritten
     * text from the connectionless session to the delegate view.
     *
     * @param delegateView delegate view capable of receiving input via {@link InputConnection}
     * @param delegateView delegate view capable of receiving input via {@link InputConnection}
     *  on which {@link #startStylusHandwriting(View)} will be called.
     *  on which {@link #startStylusHandwriting(View)} will be called.
     * @param delegatorPackageName package name of the delegator that handled initial stylus stroke.
     * @param delegatorPackageName package name of the delegator that handled initial stylus stroke.
@@ -2957,6 +2962,8 @@ public final class InputMethodManager {
     *                The framework only holds a weak reference.
     *                The framework only holds a weak reference.
     * @see #prepareStylusHandwritingDelegation(View, String)
     * @see #prepareStylusHandwritingDelegation(View, String)
     * @see #acceptStylusHandwritingDelegation(View)
     * @see #acceptStylusHandwritingDelegation(View)
     * @see #startConnectionlessStylusHandwritingForDelegation(View, CursorAnchorInfo, String,
     *     Executor, ConnectionlessHandwritingCallback)
     */
     */
    @FlaggedApi(Flags.FLAG_USE_ZERO_JANK_PROXY)
    @FlaggedApi(Flags.FLAG_USE_ZERO_JANK_PROXY)
    public void acceptStylusHandwritingDelegation(
    public void acceptStylusHandwritingDelegation(
@@ -2977,6 +2984,11 @@ public final class InputMethodManager {
     * #prepareStylusHandwritingDelegation(View, String)} from the delegator and the view belongs to
     * #prepareStylusHandwritingDelegation(View, String)} from the delegator and the view belongs to
     * a specified delegate package.
     * a specified delegate package.
     *
     *
     * <p>Otherwise, if the delegator view previously started delegation using {@link
     * #startConnectionlessStylusHandwritingForDelegation(View, CursorAnchorInfo, String, Executor,
     * ConnectionlessHandwritingCallback)}, requests the IME to commit the recognised handwritten
     * text from the connectionless session to the delegate view.
     *
     * <p>Note: If delegator and delegate are in the same application package, use {@link
     * <p>Note: If delegator and delegate are in the same application package, use {@link
     * #acceptStylusHandwritingDelegation(View)} instead.
     * #acceptStylusHandwritingDelegation(View)} instead.
     *
     *
@@ -2988,15 +3000,9 @@ public final class InputMethodManager {
     *                 hold a reference to the callback. The framework only holds a weak reference.
     *                 hold a reference to the callback. The framework only holds a weak reference.
     * @see #prepareStylusHandwritingDelegation(View, String)
     * @see #prepareStylusHandwritingDelegation(View, String)
     * @see #acceptStylusHandwritingDelegation(View)
     * @see #acceptStylusHandwritingDelegation(View)
     * @see #startConnectionlessStylusHandwritingForDelegation(View, CursorAnchorInfo, String,
     *     Executor, ConnectionlessHandwritingCallback)
     */
     */
    // TODO(b/300979854): Once connectionless APIs are finalised, update documentation to add:
    // <p>Otherwise, if the delegator view previously started delegation using {@link
    // #startConnectionlessStylusHandwritingForDelegation(View, ResultReceiver, CursorAnchorInfo,
    // String)}, requests the IME to commit the recognised handwritten text from the connectionless
    // session to the delegate view.
    // @see #startConnectionlessStylusHandwritingForDelegation(View, ResultReceiver,
    //     CursorAnchorInfo, String)
    //
    @FlaggedApi(FLAG_HOME_SCREEN_HANDWRITING_DELEGATOR)
    @FlaggedApi(FLAG_HOME_SCREEN_HANDWRITING_DELEGATOR)
    public void acceptStylusHandwritingDelegation(
    public void acceptStylusHandwritingDelegation(
            @NonNull View delegateView, @NonNull String delegatorPackageName,
            @NonNull View delegateView, @NonNull String delegatorPackageName,