1 /*
2  * Copyright (C) 2016 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 android.graphics.Rect;
20 import android.os.Bundle;
21 import android.os.IBinder;
22 import android.service.autofill.FillEventHistory;
23 import android.view.autofill.AutofillId;
24 import android.view.autofill.AutofillValue;
25 import android.view.autofill.IAutoFillManagerClient;
26 
27 /**
28  * Mediator between apps being auto-filled and auto-fill service implementations.
29  *
30  * {@hide}
31  */
32 interface IAutoFillManager {
33     // Returns flags: FLAG_ADD_CLIENT_ENABLED | FLAG_ADD_CLIENT_DEBUG | FLAG_ADD_CLIENT_VERBOSE
addClient(in IAutoFillManagerClient client, int userId)34     int addClient(in IAutoFillManagerClient client, int userId);
startSession(IBinder activityToken, in IBinder appCallback, in AutofillId autoFillId, in Rect bounds, in AutofillValue value, int userId, boolean hasCallback, int flags, String packageName)35     int startSession(IBinder activityToken, in IBinder appCallback, in AutofillId autoFillId,
36             in Rect bounds, in AutofillValue value, int userId, boolean hasCallback, int flags,
37             String packageName);
getFillEventHistory()38     FillEventHistory getFillEventHistory();
restoreSession(int sessionId, in IBinder activityToken, in IBinder appCallback)39     boolean restoreSession(int sessionId, in IBinder activityToken, in IBinder appCallback);
updateSession(int sessionId, in AutofillId id, in Rect bounds, in AutofillValue value, int action, int flags, int userId)40     void updateSession(int sessionId, in AutofillId id, in Rect bounds,
41             in AutofillValue value, int action, int flags, int userId);
updateOrRestartSession(IBinder activityToken, in IBinder appCallback, in AutofillId autoFillId, in Rect bounds, in AutofillValue value, int userId, boolean hasCallback, int flags, String packageName, int sessionId, int action)42     int updateOrRestartSession(IBinder activityToken, in IBinder appCallback,
43             in AutofillId autoFillId, in Rect bounds, in AutofillValue value, int userId,
44             boolean hasCallback, int flags, String packageName, int sessionId, int action);
finishSession(int sessionId, int userId)45     void finishSession(int sessionId, int userId);
cancelSession(int sessionId, int userId)46     void cancelSession(int sessionId, int userId);
setAuthenticationResult(in Bundle data, int sessionId, int authenticationId, int userId)47     void setAuthenticationResult(in Bundle data, int sessionId, int authenticationId, int userId);
setHasCallback(int sessionId, int userId, boolean hasIt)48     void setHasCallback(int sessionId, int userId, boolean hasIt);
disableOwnedAutofillServices(int userId)49     void disableOwnedAutofillServices(int userId);
isServiceSupported(int userId)50     boolean isServiceSupported(int userId);
isServiceEnabled(int userId, String packageName)51     boolean isServiceEnabled(int userId, String packageName);
52 }
53