1 /*
2  * Copyright (C) 2018 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 android.view.autofill;
18 
19 import java.util.List;
20 
21 import android.app.assist.AssistStructure;
22 import android.graphics.Rect;
23 import android.view.autofill.AutofillId;
24 import android.view.autofill.AutofillValue;
25 import android.view.autofill.IAutofillWindowPresenter;
26 
27 /**
28  * Object running in the application process and responsible to provide the functionalities
29  * required by an Augmented Autofill service.
30  *
31  * @hide
32  */
33 interface IAugmentedAutofillManagerClient {
34     /**
35       * Gets the coordinates of the input field view.
36       */
getViewCoordinates(in AutofillId id)37     Rect getViewCoordinates(in AutofillId id);
38 
39     /**
40       * Gets the autofill view structure of the input field view.
41       */
getViewNodeParcelable(in AutofillId id)42     AssistStructure.ViewNodeParcelable getViewNodeParcelable(in AutofillId id);
43 
44     /**
45      * Autofills the activity with the contents of the values.
46      */
autofill(int sessionId, in List<AutofillId> ids, in List<AutofillValue> values, boolean hideHighlight)47     void autofill(int sessionId, in List<AutofillId> ids, in List<AutofillValue> values,
48             boolean hideHighlight);
49 
50     /**
51       * Requests showing the fill UI.
52       */
requestShowFillUi(int sessionId, in AutofillId id, int width, int height, in Rect anchorBounds, in IAutofillWindowPresenter presenter)53     void requestShowFillUi(int sessionId, in AutofillId id, int width, int height,
54             in Rect anchorBounds, in IAutofillWindowPresenter presenter);
55 
56     /**
57       * Requests hiding the fill UI.
58       */
requestHideFillUi(int sessionId, in AutofillId id)59     void requestHideFillUi(int sessionId, in AutofillId id);
60 
61     /**
62       * Requests to start a new autofill flow. Returns true if the autofill request is made to
63       * {@link AutofillManager#requestAutofill(View)}.
64       */
requestAutofill(int sessionId, in AutofillId id)65     boolean requestAutofill(int sessionId, in AutofillId id);
66 }
67