1 /*
2  * Copyright (C) 2024 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.internal.inputmethod;
18 
19 import android.annotation.BinderThread;
20 import android.view.autofill.AutofillId;
21 import android.view.inputmethod.InlineSuggestionsRequest;
22 
23 /**
24  * An internal interface that mirrors {@link IInlineSuggestionsRequestCallback}.
25  *
26  * <p>This interface is used to forward incoming IPCs from
27  * {@link com.android.server.inputmethod.AutofillSuggestionsController} to
28  * {@link com.android.server.autofill.AutofillInlineSuggestionsRequestSession}.</p>
29  */
30 public interface InlineSuggestionsRequestCallback {
31 
32     /**
33      * Forwards {@link IInlineSuggestionsRequestCallback#onInlineSuggestionsUnsupported()}.
34      */
35     @BinderThread
onInlineSuggestionsUnsupported()36     void onInlineSuggestionsUnsupported();
37 
38     /**
39      * Forwards {@link IInlineSuggestionsRequestCallback#onInlineSuggestionsRequest(
40      * InlineSuggestionsRequest, IInlineSuggestionsResponseCallback)}.
41      */
42     @BinderThread
onInlineSuggestionsRequest(InlineSuggestionsRequest request, IInlineSuggestionsResponseCallback callback)43     void onInlineSuggestionsRequest(InlineSuggestionsRequest request,
44             IInlineSuggestionsResponseCallback callback);
45 
46     /**
47      * Forwards {@link IInlineSuggestionsRequestCallback#onInputMethodStartInput(AutofillId)}.
48      */
49     @BinderThread
onInputMethodStartInput(AutofillId imeFieldId)50     void onInputMethodStartInput(AutofillId imeFieldId);
51 
52     /**
53      * Forwards {@link IInlineSuggestionsRequestCallback#onInputMethodShowInputRequested(boolean)}.
54      */
55     @BinderThread
onInputMethodShowInputRequested(boolean requestResult)56     void onInputMethodShowInputRequested(boolean requestResult);
57 
58     /**
59      * Forwards {@link IInlineSuggestionsRequestCallback#onInputMethodStartInputView()}.
60      */
61     @BinderThread
onInputMethodStartInputView()62     void onInputMethodStartInputView();
63 
64     /**
65      * Forwards {@link IInlineSuggestionsRequestCallback#onInputMethodFinishInputView()}.
66      */
67     @BinderThread
onInputMethodFinishInputView()68     void onInputMethodFinishInputView();
69 
70     /**
71      * Forwards {@link IInlineSuggestionsRequestCallback#onInputMethodFinishInput()}.
72      */
73     @BinderThread
onInputMethodFinishInput()74     void onInputMethodFinishInput();
75 
76     /**
77      * Forwards {@link IInlineSuggestionsRequestCallback#onInlineSuggestionsSessionInvalidated()}.
78      */
79     @BinderThread
onInlineSuggestionsSessionInvalidated()80     void onInlineSuggestionsSessionInvalidated();
81 }
82