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 java.util.List;
20 
21 import android.content.ComponentName;
22 import android.graphics.Rect;
23 import android.os.Bundle;
24 import android.os.IBinder;
25 import android.os.RemoteCallback;
26 import android.service.autofill.FillEventHistory;
27 import android.service.autofill.UserData;
28 import android.view.autofill.AutofillId;
29 import android.view.autofill.AutofillValue;
30 import android.view.autofill.IAutoFillManagerClient;
31 
32 /**
33  * Mediator between apps being auto-filled and auto-fill service implementations.
34  *
35  * {@hide}
36  */
37 interface IAutoFillManager {
38     // Returns flags: FLAG_ADD_CLIENT_ENABLED | FLAG_ADD_CLIENT_DEBUG | FLAG_ADD_CLIENT_VERBOSE
addClient(in IAutoFillManagerClient client, int userId)39     int addClient(in IAutoFillManagerClient client, int userId);
removeClient(in IAutoFillManagerClient client, int userId)40     void removeClient(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, in ComponentName componentName, boolean compatMode)41     int startSession(IBinder activityToken, in IBinder appCallback, in AutofillId autoFillId,
42             in Rect bounds, in AutofillValue value, int userId, boolean hasCallback, int flags,
43             in ComponentName componentName, boolean compatMode);
getFillEventHistory()44     FillEventHistory getFillEventHistory();
restoreSession(int sessionId, in IBinder activityToken, in IBinder appCallback)45     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)46     void updateSession(int sessionId, in AutofillId id, in Rect bounds,
47             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, in ComponentName componentName, int sessionId, int action, boolean compatMode)48     int updateOrRestartSession(IBinder activityToken, in IBinder appCallback,
49             in AutofillId autoFillId, in Rect bounds, in AutofillValue value, int userId,
50             boolean hasCallback, int flags, in ComponentName componentName, int sessionId,
51             int action, boolean compatMode);
setAutofillFailure(int sessionId, in List<AutofillId> ids, int userId)52     void setAutofillFailure(int sessionId, in List<AutofillId> ids, int userId);
finishSession(int sessionId, int userId)53     void finishSession(int sessionId, int userId);
cancelSession(int sessionId, int userId)54     void cancelSession(int sessionId, int userId);
setAuthenticationResult(in Bundle data, int sessionId, int authenticationId, int userId)55     void setAuthenticationResult(in Bundle data, int sessionId, int authenticationId, int userId);
setHasCallback(int sessionId, int userId, boolean hasIt)56     void setHasCallback(int sessionId, int userId, boolean hasIt);
disableOwnedAutofillServices(int userId)57     void disableOwnedAutofillServices(int userId);
isServiceSupported(int userId)58     boolean isServiceSupported(int userId);
isServiceEnabled(int userId, String packageName)59     boolean isServiceEnabled(int userId, String packageName);
onPendingSaveUi(int operation, IBinder token)60     void onPendingSaveUi(int operation, IBinder token);
getUserData()61     UserData getUserData();
getUserDataId()62     String getUserDataId();
setUserData(in UserData userData)63     void setUserData(in UserData userData);
isFieldClassificationEnabled()64     boolean isFieldClassificationEnabled();
getAutofillServiceComponentName()65     ComponentName getAutofillServiceComponentName();
getAvailableFieldClassificationAlgorithms()66     String[] getAvailableFieldClassificationAlgorithms();
getDefaultFieldClassificationAlgorithm()67     String getDefaultFieldClassificationAlgorithm();
68 }
69