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

Commit 02bfb2de authored by Justin Ghan's avatar Justin Ghan
Browse files

Javadoc updates for connectionless handwriting APIs

Test: N/A
Bug: 300979854
Flag: DOCS_ONLY
Change-Id: I08b6c17e3f9894cfde987c8418f06d4918268635
parent 1d39426b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2794,6 +2794,9 @@ public class InputMethodService extends AbstractInputMethodService {
     * <p>This dismisses the {@link #getStylusHandwritingWindow ink window} and stops intercepting
     * 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
     * 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.
@@ -2801,9 +2804,6 @@ public class InputMethodService extends AbstractInputMethodService {
     *
     * <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() {
        if (DEBUG) Log.v(TAG, "finishStylusHandwriting()");
        if (mInkWindow == null) {
+28 −22
Original line number Diff line number Diff line
@@ -2883,6 +2883,11 @@ public final class InputMethodManager {
     * initiation delegation was previously requested using
     * {@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
     * {@link #acceptStylusHandwritingDelegation(View, String)} instead.</p>
     *
@@ -2891,14 +2896,9 @@ public final class InputMethodManager {
     *  {@link #prepareStylusHandwritingDelegation(View)} and delegation is accepted
     * @see #prepareStylusHandwritingDelegation(View)
     * @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) {
        return startStylusHandwritingInternal(
                delegateView, delegateView.getContext().getOpPackageName(),
@@ -2911,6 +2911,11 @@ public final class InputMethodManager {
     * {@link #prepareStylusHandwritingDelegation(View, String)} from the delegator and the view
     * 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
     * {@link #acceptStylusHandwritingDelegation(View)} instead.</p>
     *
@@ -2920,15 +2925,10 @@ public final class InputMethodManager {
     *     #prepareStylusHandwritingDelegation(View, String)} and delegation is accepted
     * @see #prepareStylusHandwritingDelegation(View, String)
     * @see #acceptStylusHandwritingDelegation(View)
     * @see #startConnectionlessStylusHandwritingForDelegation(View, CursorAnchorInfo, String,
     *     Executor, ConnectionlessHandwritingCallback)
     * 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(
            @NonNull View delegateView, @NonNull String delegatorPackageName) {
        Objects.requireNonNull(delegatorPackageName);
@@ -2942,6 +2942,11 @@ public final class InputMethodManager {
     * {@link #prepareStylusHandwritingDelegation(View, String)} from the delegator and the view
     * 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}
     *  on which {@link #startStylusHandwriting(View)} will be called.
     * @param delegatorPackageName package name of the delegator that handled initial stylus stroke.
@@ -2952,6 +2957,8 @@ public final class InputMethodManager {
     *                session can start.
     * @see #prepareStylusHandwritingDelegation(View, String)
     * @see #acceptStylusHandwritingDelegation(View)
     * @see #startConnectionlessStylusHandwritingForDelegation(View, CursorAnchorInfo, String,
     *     Executor, ConnectionlessHandwritingCallback)
     */
    @FlaggedApi(Flags.FLAG_USE_ZERO_JANK_PROXY)
    public void acceptStylusHandwritingDelegation(
@@ -2972,6 +2979,11 @@ public final class InputMethodManager {
     * #prepareStylusHandwritingDelegation(View, String)} from the delegator and the view 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 {@link
     * #acceptStylusHandwritingDelegation(View)} instead.
     *
@@ -2982,15 +2994,9 @@ public final class InputMethodManager {
     * @param callback {@code true>} would be received if delegation was accepted.
     * @see #prepareStylusHandwritingDelegation(View, String)
     * @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)
    public void acceptStylusHandwritingDelegation(
            @NonNull View delegateView, @NonNull String delegatorPackageName,