129a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme/*
229a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme * Copyright (C) 2016 The Android Open Source Project
329a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme *
429a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme * Licensed under the Apache License, Version 2.0 (the "License");
529a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme * you may not use this file except in compliance with the License.
629a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme * You may obtain a copy of the License at
729a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme *
829a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme *      http://www.apache.org/licenses/LICENSE-2.0
929a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme *
1029a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme * Unless required by applicable law or agreed to in writing, software
1129a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme * distributed under the License is distributed on an "AS IS" BASIS,
1229a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1329a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme * See the License for the specific language governing permissions and
1429a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme * limitations under the License.
1529a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme */
1629a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme
17782043caf81055aa1c331e9cc15b24a10e1bf17aSvet Ganovpackage android.view.autofill;
1829a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme
1929a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Lemeimport java.util.List;
2029a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme
210f4928f1f73407485d6d94beda1dba1a2360ebbfSvet Ganovimport android.content.Intent;
220f4928f1f73407485d6d94beda1dba1a2360ebbfSvet Ganovimport android.content.IntentSender;
234753bb0c34e068f57fff208529836a7688b3ef41Felipe Lemeimport android.graphics.Rect;
24e6010f2fb4d512c00a21cda55197f5f57e63fdc1Felipe Lemeimport android.os.IBinder;
25640f30a7763b0a4b80c767acb84c740aac04768bFelipe Lemeimport android.view.autofill.AutofillId;
26640f30a7763b0a4b80c767acb84c740aac04768bFelipe Lemeimport android.view.autofill.AutofillValue;
274753bb0c34e068f57fff208529836a7688b3ef41Felipe Lemeimport android.view.autofill.IAutofillWindowPresenter;
286d553874bed06280766ae24ea605f9bbde3f5a4aFelipe Leme
2929a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme/**
30640f30a7763b0a4b80c767acb84c740aac04768bFelipe Leme * Object running in the application process and responsible for autofilling it.
31436ab6a91d64ef6036c67bb361d807e398fb2c4cFelipe Leme *
3229a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme * @hide
3329a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme */
34782043caf81055aa1c331e9cc15b24a10e1bf17aSvet Ganovoneway interface IAutoFillManagerClient {
35436ab6a91d64ef6036c67bb361d807e398fb2c4cFelipe Leme    /**
36640f30a7763b0a4b80c767acb84c740aac04768bFelipe Leme     * Notifies the client when the autofill enabled state changed.
37782043caf81055aa1c331e9cc15b24a10e1bf17aSvet Ganov     */
3848f10a2ab53e415f34d86ac717b4f6412dfc824fSvet Ganov    void setState(boolean enabled, boolean resetSession, boolean resetClient);
390f4928f1f73407485d6d94beda1dba1a2360ebbfSvet Ganov
400f4928f1f73407485d6d94beda1dba1a2360ebbfSvet Ganov    /**
41640f30a7763b0a4b80c767acb84c740aac04768bFelipe Leme      * Autofills the activity with the contents of a dataset.
420f4928f1f73407485d6d94beda1dba1a2360ebbfSvet Ganov      */
43134cee27b8a54ff4c8bebda51c5fe4a4e6f1fd8aPhilip P. Moltmann    void autofill(int sessionId, in List<AutofillId> ids, in List<AutofillValue> values);
44bab851c7c9dfe6f3d063a1009c4d57cfa2ff005cFelipe Leme
45bab851c7c9dfe6f3d063a1009c4d57cfa2ff005cFelipe Leme    /**
46782043caf81055aa1c331e9cc15b24a10e1bf17aSvet Ganov      * Authenticates a fill response or a data set.
47bab851c7c9dfe6f3d063a1009c4d57cfa2ff005cFelipe Leme      */
48a9379d0b44ca1f68a0036d2b65218e17fa348514Svetoslav Ganov    void authenticate(int sessionId, int authenticationId, in IntentSender intent,
49a9379d0b44ca1f68a0036d2b65218e17fa348514Svetoslav Ganov            in Intent fillInIntent);
50e6010f2fb4d512c00a21cda55197f5f57e63fdc1Felipe Leme
51e6010f2fb4d512c00a21cda55197f5f57e63fdc1Felipe Leme    /**
52494c3f5da2c467ad07f50b4e1ad01065a8e3aa4fPhilip P. Moltmann      * Sets the views to track. If saveOnAllViewsInvisible is set and all these view are invisible
53494c3f5da2c467ad07f50b4e1ad01065a8e3aa4fPhilip P. Moltmann      * the session is finished automatically.
54494c3f5da2c467ad07f50b4e1ad01065a8e3aa4fPhilip P. Moltmann      */
5527e202208b42e78fefcece893a4bb5d8fe2eae58Felipe Leme    void setTrackedViews(int sessionId, in @nullable AutofillId[] savableIds,
5627e202208b42e78fefcece893a4bb5d8fe2eae58Felipe Leme            boolean saveOnAllViewsInvisible, in @nullable AutofillId[] fillableIds);
57494c3f5da2c467ad07f50b4e1ad01065a8e3aa4fPhilip P. Moltmann
58494c3f5da2c467ad07f50b4e1ad01065a8e3aa4fPhilip P. Moltmann    /**
594753bb0c34e068f57fff208529836a7688b3ef41Felipe Leme     * Requests showing the fill UI.
60e6010f2fb4d512c00a21cda55197f5f57e63fdc1Felipe Leme     */
61134cee27b8a54ff4c8bebda51c5fe4a4e6f1fd8aPhilip P. Moltmann    void requestShowFillUi(int sessionId, in AutofillId id, int width, int height,
62134cee27b8a54ff4c8bebda51c5fe4a4e6f1fd8aPhilip P. Moltmann    in Rect anchorBounds, in IAutofillWindowPresenter presenter);
634753bb0c34e068f57fff208529836a7688b3ef41Felipe Leme
644753bb0c34e068f57fff208529836a7688b3ef41Felipe Leme    /**
654753bb0c34e068f57fff208529836a7688b3ef41Felipe Leme     * Requests hiding the fill UI.
664753bb0c34e068f57fff208529836a7688b3ef41Felipe Leme     */
67134cee27b8a54ff4c8bebda51c5fe4a4e6f1fd8aPhilip P. Moltmann    void requestHideFillUi(int sessionId, in AutofillId id);
684753bb0c34e068f57fff208529836a7688b3ef41Felipe Leme
694753bb0c34e068f57fff208529836a7688b3ef41Felipe Leme    /**
70c3d1c85bda1eb0a7f5a45cbe51406f2239b57cb2Svet Ganov     * Notifies no fill UI will be shown.
714753bb0c34e068f57fff208529836a7688b3ef41Felipe Leme     */
72134cee27b8a54ff4c8bebda51c5fe4a4e6f1fd8aPhilip P. Moltmann    void notifyNoFillUi(int sessionId, in AutofillId id);
73c3d1c85bda1eb0a7f5a45cbe51406f2239b57cb2Svet Ganov
74c3d1c85bda1eb0a7f5a45cbe51406f2239b57cb2Svet Ganov    /**
75c3d1c85bda1eb0a7f5a45cbe51406f2239b57cb2Svet Ganov     * Starts the provided intent sender
76c3d1c85bda1eb0a7f5a45cbe51406f2239b57cb2Svet Ganov     */
77c3d1c85bda1eb0a7f5a45cbe51406f2239b57cb2Svet Ganov    void startIntentSender(in IntentSender intentSender);
7829a5b0d0f1cc7fd6cbfe97c816b8a687d9e438ccFelipe Leme}
79