• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2019 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.view;
18 
19 import android.view.autofill.AutofillId;
20 import android.view.inputmethod.InlineSuggestionsRequest;
21 
22 import com.android.internal.view.IInlineSuggestionsResponseCallback;
23 
24 /**
25  * Binder interface for the IME service to send {@link InlineSuggestionsRequest} or notify other IME
26  * service events to the system.
27  * {@hide}
28  */
29 oneway interface IInlineSuggestionsRequestCallback {
30     /** Indicates that the current IME does not support inline suggestion. */
onInlineSuggestionsUnsupported()31     void onInlineSuggestionsUnsupported();
32 
33     /**
34      * Sends the inline suggestions request from IME to Autofill. Calling this method indicates
35      * that the IME input is started on the view corresponding to the request.
36      */
onInlineSuggestionsRequest(in InlineSuggestionsRequest request, in IInlineSuggestionsResponseCallback callback)37     void onInlineSuggestionsRequest(in InlineSuggestionsRequest request,
38             in IInlineSuggestionsResponseCallback callback);
39 
40     /**
41      * Signals that {@link android.inputmethodservice.InputMethodService
42      * #onStartInput(EditorInfo, boolean)} is called on the given focused field.
43      */
onInputMethodStartInput(in AutofillId imeFieldId)44     void onInputMethodStartInput(in AutofillId imeFieldId);
45 
46     /**
47      * Signals that {@link android.inputmethodservice.InputMethodService
48      * #dispatchOnShowInputRequested(int, boolean)} is called and shares the call result.
49      * The true value of {@code requestResult} means the IME is about to be shown, while
50      * false value means the IME will not be shown.
51      */
onInputMethodShowInputRequested(boolean requestResult)52     void onInputMethodShowInputRequested(boolean requestResult);
53 
54     /**
55      * Signals that {@link android.inputmethodservice.InputMethodService
56      * #onStartInputView(EditorInfo, boolean)} is called on the field specified by the earlier
57      * {@link #onInputMethodStartInput(AutofillId)}.
58      */
onInputMethodStartInputView()59     void onInputMethodStartInputView();
60 
61     /**
62      * Signals that {@link android.inputmethodservice.InputMethodService
63      * #onFinishInputView(boolean)} is called on the field specified by the earlier
64      * {@link #onInputMethodStartInput(AutofillId)}.
65      */
onInputMethodFinishInputView()66     void onInputMethodFinishInputView();
67 
68     /**
69      * Signals that {@link android.inputmethodservice.InputMethodService
70      * #onFinishInput()} is called on the field specified by the earlier
71      * {@link #onInputMethodStartInput(AutofillId)}.
72      */
onInputMethodFinishInput()73     void onInputMethodFinishInput();
74 
75     // Indicates that the current IME changes inline suggestion session.
onInlineSuggestionsSessionInvalidated()76     void onInlineSuggestionsSessionInvalidated();
77 }
78