| 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.ClipData; |
| 22 |
import android.content.ComponentName; |
| 23 |
import android.content.Intent; |
| 24 |
import android.content.IntentSender; |
| 25 |
import android.graphics.Rect; |
| 26 |
import android.os.IBinder; |
| 27 |
import android.view.autofill.AutofillId; |
| 28 |
import android.view.autofill.AutofillValue; |
| 29 |
import android.view.autofill.IAutofillWindowPresenter; |
| 30 |
import android.view.KeyEvent; |
| 31 |
|
| 32 |
import com.android.internal.os.IResultReceiver; |
| 33 |
|
| 34 |
/** |
| 35 |
* Object running in the application process and responsible for autofilling it. |
| 36 |
* |
| 37 |
* @hide |
| 38 |
*/ |
| 39 |
oneway interface IAutoFillManagerClient { |
| 40 |
/** |
| 41 |
* Notifies the client when the autofill enabled state changed. |
| 42 |
*/ |
| 43 |
void setState(int flags); |
| 44 |
|
| 45 |
/** |
| 46 |
* Autofills the activity with the contents of a dataset. |
| 47 |
*/ |
| 48 |
void autofill(int sessionId, in List<AutofillId> ids, in List<AutofillValue> values, |
| 49 |
boolean hideHighlight); |
| 50 |
|
| 51 |
/** |
| 52 |
* Autofills the activity with rich content data (e.g. an image) from a dataset. |
| 53 |
*/ |
| 54 |
void autofillContent(int sessionId, in AutofillId id, in ClipData content); |
| 55 |
|
| 56 |
/** |
| 57 |
* Authenticates a fill response or a data set. |
| 58 |
*/ |
| 59 |
void authenticate(int sessionId, int authenticationId, in IntentSender intent, |
| 60 |
in Intent fillInIntent, boolean authenticateInline); |
| 61 |
|
| 62 |
/** |
| 63 |
* Sets the views to track. If saveOnAllViewsInvisible is set and all these view are invisible |
| 64 |
* the session is finished automatically. |
| 65 |
*/ |
| 66 |
void setTrackedViews(int sessionId, in @nullable AutofillId[] savableIds, |
| 67 |
boolean saveOnAllViewsInvisible, boolean saveOnFinish, |
| 68 |
in @nullable AutofillId[] fillableIds, in AutofillId saveTriggerId); |
| 69 |
|
| 70 |
/** |
| 71 |
* Requests showing the fill UI. |
| 72 |
*/ |
| 73 |
void requestShowFillUi(int sessionId, in AutofillId id, int width, int height, |
| 74 |
in Rect anchorBounds, in IAutofillWindowPresenter presenter); |
| 75 |
|
| 76 |
/** |
| 77 |
* Requests hiding the fill UI. |
| 78 |
*/ |
| 79 |
void requestHideFillUi(int sessionId, in AutofillId id); |
| 80 |
|
| 81 |
/** |
| 82 |
* Notifies no fill UI will be shown, and also mark the state as finished if necessary (if |
| 83 |
* sessionFinishedState != 0). |
| 84 |
*/ |
| 85 |
void notifyNoFillUi(int sessionId, in AutofillId id, int sessionFinishedState); |
| 86 |
|
| 87 |
/** |
| 88 |
* Notifies that the fill UI was shown by the system (e.g. as inline chips in the keyboard). |
| 89 |
*/ |
| 90 |
void notifyFillUiShown(int sessionId, in AutofillId id); |
| 91 |
|
| 92 |
/** |
| 93 |
* Notifies that the fill UI previously shown by the system has been hidden by the system. |
| 94 |
* |
| 95 |
* @see #notifyFillUiShown |
| 96 |
*/ |
| 97 |
void notifyFillUiHidden(int sessionId, in AutofillId id); |
| 98 |
|
| 99 |
/** |
| 100 |
* Dispatches unhandled keyevent from autofill ui. Autofill ui handles DPAD and ENTER events, |
| 101 |
* other unhandled keyevents are dispatched to app's window to filter autofill result. |
| 102 |
* Note this method is not called when autofill ui is in fullscreen mode (TV only). |
| 103 |
*/ |
| 104 |
void dispatchUnhandledKey(int sessionId, in AutofillId id, in KeyEvent keyEvent); |
| 105 |
|
| 106 |
/** |
| 107 |
* Starts the provided intent sender. |
| 108 |
*/ |
| 109 |
void startIntentSender(in IntentSender intentSender, in Intent intent); |
| 110 |
|
| 111 |
/** |
| 112 |
* Sets the state of the Autofill Save UI for a given session. |
| 113 |
*/ |
| 114 |
void setSaveUiState(int sessionId, boolean shown); |
| 115 |
|
| 116 |
/** |
| 117 |
* Marks the state of the session as finished. |
| 118 |
* |
| 119 |
* @param newState STATE_FINISHED (because the autofill service returned a null |
| 120 |
* FillResponse) or STATE_UNKNOWN (because the session was removed). |
| 121 |
* @param autofillableIds list of ids that could trigger autofill, use to not handle a new |
| 122 |
* session when they're entered. |
| 123 |
*/ |
| 124 |
void setSessionFinished(int newState, in List<AutofillId> autofillableIds); |
| 125 |
|
| 126 |
/** |
| 127 |
* Gets a reference to the binder object that can be used by the Augmented Autofill service. |
| 128 |
* |
| 129 |
* @param receiver, whose AutofillManager.EXTRA_AUGMENTED_AUTOFILL_CLIENT extra will contain |
| 130 |
* the reference. |
| 131 |
*/ |
| 132 |
void getAugmentedAutofillClient(in IResultReceiver result); |
| 133 |
|
| 134 |
/** |
| 135 |
* Notifies disables autofill for the app or activity. |
| 136 |
*/ |
| 137 |
void notifyDisableAutofill(long disableDuration, in ComponentName componentName); |
| 138 |
|
| 139 |
/** |
| 140 |
* Requests to show the soft input method if the focus is on the given id. |
| 141 |
*/ |
| 142 |
void requestShowSoftInput(in AutofillId id); |
| 143 |
|
| 144 |
/** |
| 145 |
* Notifies autofill ids that require to show the fill dialog. |
| 146 |
*/ |
| 147 |
void notifyFillDialogTriggerIds(in List<AutofillId> ids); |
| 148 |
} |