Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 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.service.autofill; |
| 18 | |
| 19 | import android.annotation.IntDef; |
| 20 | import android.annotation.NonNull; |
| 21 | import android.annotation.Nullable; |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 22 | import android.os.Bundle; |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 23 | import android.os.Parcel; |
| 24 | import android.os.Parcelable; |
Felipe Leme | 2ef19c1 | 2017-06-05 11:32:32 -0700 | [diff] [blame] | 25 | import android.view.View; |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 26 | import android.view.inputmethod.InlineSuggestionsRequest; |
Philip P. Moltmann | 121e526 | 2017-04-25 13:33:41 -0700 | [diff] [blame] | 27 | |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 28 | import com.android.internal.util.DataClass; |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 29 | import com.android.internal.util.Preconditions; |
| 30 | |
| 31 | import java.lang.annotation.Retention; |
| 32 | import java.lang.annotation.RetentionPolicy; |
Philip P. Moltmann | 121e526 | 2017-04-25 13:33:41 -0700 | [diff] [blame] | 33 | import java.util.ArrayList; |
Jeff Sharkey | 000ce80 | 2017-04-29 13:13:27 -0600 | [diff] [blame] | 34 | import java.util.List; |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 35 | |
| 36 | /** |
Felipe Leme | 2ef19c1 | 2017-06-05 11:32:32 -0700 | [diff] [blame] | 37 | * This class represents a request to an autofill service |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 38 | * to interpret the screen and provide information to the system which views are |
| 39 | * interesting for saving and what are the possible ways to fill the inputs on |
| 40 | * the screen if applicable. |
| 41 | * |
Felipe Leme | a012d7e | 2017-09-06 15:19:11 -0700 | [diff] [blame] | 42 | * @see AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal, FillCallback) |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 43 | */ |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 44 | @DataClass( |
| 45 | genToString = true, |
| 46 | genHiddenConstructor = true, |
| 47 | genHiddenConstDefs = true) |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 48 | public final class FillRequest implements Parcelable { |
Felipe Leme | 2ef19c1 | 2017-06-05 11:32:32 -0700 | [diff] [blame] | 49 | |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 50 | /** |
| 51 | * Indicates autofill was explicitly requested by the user. |
Felipe Leme | 2ef19c1 | 2017-06-05 11:32:32 -0700 | [diff] [blame] | 52 | * |
| 53 | * <p>Users typically make an explicit request to autofill a screen in two situations: |
| 54 | * <ul> |
| 55 | * <li>The app disabled autofill (using {@link View#setImportantForAutofill(int)}. |
| 56 | * <li>The service could not figure out how to autofill a screen (but the user knows the |
| 57 | * service has data for that app). |
| 58 | * </ul> |
| 59 | * |
| 60 | * <p>This flag is particularly useful for the second case. For example, the service could offer |
| 61 | * a complex UI where the user can map which screen views belong to each user data, or it could |
| 62 | * offer a simpler UI where the user picks the data for just the view used to trigger the |
| 63 | * request (that would be the view whose |
| 64 | * {@link android.app.assist.AssistStructure.ViewNode#isFocused()} method returns {@code true}). |
| 65 | * |
| 66 | * <p>An explicit autofill request is triggered when the |
| 67 | * {@link android.view.autofill.AutofillManager#requestAutofill(View)} or |
| 68 | * {@link android.view.autofill.AutofillManager#requestAutofill(View, int, android.graphics.Rect)} |
Jeff Sharkey | 67f9d50 | 2017-08-05 13:49:13 -0600 | [diff] [blame] | 69 | * is called. For example, standard {@link android.widget.TextView} views show an |
| 70 | * {@code AUTOFILL} option in the overflow menu that triggers such request. |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 71 | */ |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 72 | public static final @RequestFlags int FLAG_MANUAL_REQUEST = 0x1; |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 73 | |
Felipe Leme | eacd74d | 2018-08-02 10:36:34 -0700 | [diff] [blame] | 74 | /** |
| 75 | * Indicates this request was made using |
| 76 | * <a href="AutofillService.html#CompatibilityMode">compatibility mode</a>. |
| 77 | */ |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 78 | public static final @RequestFlags int FLAG_COMPATIBILITY_MODE_REQUEST = 0x2; |
Felipe Leme | eacd74d | 2018-08-02 10:36:34 -0700 | [diff] [blame] | 79 | |
Adam He | ef0fe208 | 2019-10-25 11:58:15 -0700 | [diff] [blame] | 80 | /** |
| 81 | * Indicates the request came from a password field. |
| 82 | * |
| 83 | * (TODO: b/141703197) Temporary fix for augmented autofill showing passwords. |
| 84 | * |
| 85 | * @hide |
| 86 | */ |
| 87 | public static final @RequestFlags int FLAG_PASSWORD_INPUT_TYPE = 0x4; |
| 88 | |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 89 | /** @hide */ |
Philip P. Moltmann | c761963 | 2017-04-25 11:57:37 -0700 | [diff] [blame] | 90 | public static final int INVALID_REQUEST_ID = Integer.MIN_VALUE; |
| 91 | |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 92 | /** |
Felipe Leme | 2ef19c1 | 2017-06-05 11:32:32 -0700 | [diff] [blame] | 93 | * Gets the unique id of this request. |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 94 | */ |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 95 | private final int mId; |
| 96 | |
| 97 | /** |
| 98 | * Gets the contexts associated with each previous fill request. |
| 99 | * |
| 100 | * <p><b>Note:</b> Starting on Android {@link android.os.Build.VERSION_CODES#Q}, it could also |
| 101 | * include contexts from requests whose {@link SaveInfo} had the |
| 102 | * {@link SaveInfo#FLAG_DELAY_SAVE} flag. |
| 103 | */ |
| 104 | private final @NonNull List<FillContext> mFillContexts; |
| 105 | |
| 106 | /** |
| 107 | * Gets the latest client state bundle set by the service in a |
| 108 | * {@link FillResponse.Builder#setClientState(Bundle) fill response}. |
| 109 | * |
| 110 | * <p><b>Note:</b> Prior to Android {@link android.os.Build.VERSION_CODES#P}, only client state |
| 111 | * bundles set by {@link FillResponse.Builder#setClientState(Bundle)} were considered. On |
| 112 | * Android {@link android.os.Build.VERSION_CODES#P} and higher, bundles set in the result of |
| 113 | * an authenticated request through the |
| 114 | * {@link android.view.autofill.AutofillManager#EXTRA_CLIENT_STATE} extra are |
| 115 | * also considered (and take precedence when set). |
| 116 | * |
| 117 | * @return The client state. |
| 118 | */ |
| 119 | private final @Nullable Bundle mClientState; |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 120 | |
| 121 | /** |
Felipe Leme | 2ef19c1 | 2017-06-05 11:32:32 -0700 | [diff] [blame] | 122 | * Gets the flags associated with this request. |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 123 | * |
Felipe Leme | a7de402 | 2019-02-19 17:16:45 -0800 | [diff] [blame] | 124 | * @return any combination of {@link #FLAG_MANUAL_REQUEST} and |
| 125 | * {@link #FLAG_COMPATIBILITY_MODE_REQUEST}. |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 126 | */ |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 127 | private final @RequestFlags int mFlags; |
| 128 | |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 129 | /** |
Adam He | 045c020 | 2020-04-17 15:20:01 -0700 | [diff] [blame] | 130 | * Gets the {@link InlineSuggestionsRequest} associated |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 131 | * with this request. |
| 132 | * |
Adam He | 045c020 | 2020-04-17 15:20:01 -0700 | [diff] [blame] | 133 | * <p>Autofill Framework will send a {@code @non-null} {@link InlineSuggestionsRequest} if |
| 134 | * currently inline suggestions are supported and can be displayed. If the Autofill service |
| 135 | * wants to show inline suggestions, they may return {@link Dataset} with valid |
| 136 | * {@link InlinePresentation}.</p> |
| 137 | * |
| 138 | * <p>The Autofill Service must set supportsInlineSuggestions in its XML to enable support |
| 139 | * for inline suggestions.</p> |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 140 | * |
| 141 | * @return the suggestionspec |
| 142 | */ |
| 143 | private final @Nullable InlineSuggestionsRequest mInlineSuggestionsRequest; |
| 144 | |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 145 | private void onConstructed() { |
| 146 | Preconditions.checkCollectionElementsNotNull(mFillContexts, "contexts"); |
| 147 | } |
| 148 | |
| 149 | |
| 150 | |
Adam He | 045c020 | 2020-04-17 15:20:01 -0700 | [diff] [blame] | 151 | // Code below generated by codegen v1.0.15. |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 152 | // |
| 153 | // DO NOT MODIFY! |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 154 | // CHECKSTYLE:OFF Generated code |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 155 | // |
| 156 | // To regenerate run: |
| 157 | // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/service/autofill/FillRequest.java |
| 158 | // |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 159 | // To exclude the generated code from IntelliJ auto-formatting enable (one-time): |
| 160 | // Settings > Editor > Code Style > Formatter Control |
| 161 | //@formatter:off |
| 162 | |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 163 | |
| 164 | /** @hide */ |
| 165 | @IntDef(flag = true, prefix = "FLAG_", value = { |
| 166 | FLAG_MANUAL_REQUEST, |
Adam He | ef0fe208 | 2019-10-25 11:58:15 -0700 | [diff] [blame] | 167 | FLAG_COMPATIBILITY_MODE_REQUEST, |
| 168 | FLAG_PASSWORD_INPUT_TYPE |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 169 | }) |
| 170 | @Retention(RetentionPolicy.SOURCE) |
| 171 | @DataClass.Generated.Member |
| 172 | public @interface RequestFlags {} |
| 173 | |
| 174 | /** @hide */ |
| 175 | @DataClass.Generated.Member |
| 176 | public static String requestFlagsToString(@RequestFlags int value) { |
| 177 | return com.android.internal.util.BitUtils.flagsToString( |
| 178 | value, FillRequest::singleRequestFlagsToString); |
| 179 | } |
| 180 | |
| 181 | @DataClass.Generated.Member |
| 182 | static String singleRequestFlagsToString(@RequestFlags int value) { |
| 183 | switch (value) { |
| 184 | case FLAG_MANUAL_REQUEST: |
| 185 | return "FLAG_MANUAL_REQUEST"; |
| 186 | case FLAG_COMPATIBILITY_MODE_REQUEST: |
| 187 | return "FLAG_COMPATIBILITY_MODE_REQUEST"; |
Adam He | ef0fe208 | 2019-10-25 11:58:15 -0700 | [diff] [blame] | 188 | case FLAG_PASSWORD_INPUT_TYPE: |
| 189 | return "FLAG_PASSWORD_INPUT_TYPE"; |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 190 | default: return Integer.toHexString(value); |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * Creates a new FillRequest. |
| 196 | * |
| 197 | * @param id |
| 198 | * Gets the unique id of this request. |
| 199 | * @param fillContexts |
| 200 | * Gets the contexts associated with each previous fill request. |
| 201 | * |
| 202 | * <p><b>Note:</b> Starting on Android {@link android.os.Build.VERSION_CODES#Q}, it could also |
| 203 | * include contexts from requests whose {@link SaveInfo} had the |
| 204 | * {@link SaveInfo#FLAG_DELAY_SAVE} flag. |
| 205 | * @param clientState |
| 206 | * Gets the latest client state bundle set by the service in a |
| 207 | * {@link FillResponse.Builder#setClientState(Bundle) fill response}. |
| 208 | * |
| 209 | * <p><b>Note:</b> Prior to Android {@link android.os.Build.VERSION_CODES#P}, only client state |
| 210 | * bundles set by {@link FillResponse.Builder#setClientState(Bundle)} were considered. On |
| 211 | * Android {@link android.os.Build.VERSION_CODES#P} and higher, bundles set in the result of |
| 212 | * an authenticated request through the |
| 213 | * {@link android.view.autofill.AutofillManager#EXTRA_CLIENT_STATE} extra are |
| 214 | * also considered (and take precedence when set). |
| 215 | * @param flags |
| 216 | * Gets the flags associated with this request. |
| 217 | * |
| 218 | * @return any combination of {@link #FLAG_MANUAL_REQUEST} and |
| 219 | * {@link #FLAG_COMPATIBILITY_MODE_REQUEST}. |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 220 | * @param inlineSuggestionsRequest |
Adam He | 045c020 | 2020-04-17 15:20:01 -0700 | [diff] [blame] | 221 | * Gets the {@link InlineSuggestionsRequest} associated |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 222 | * with this request. |
| 223 | * |
Adam He | 045c020 | 2020-04-17 15:20:01 -0700 | [diff] [blame] | 224 | * <p>Autofill Framework will send a {@code @non-null} {@link InlineSuggestionsRequest} if |
| 225 | * currently inline suggestions are supported and can be displayed. If the Autofill service |
| 226 | * wants to show inline suggestions, they may return {@link Dataset} with valid |
| 227 | * {@link InlinePresentation}.</p> |
| 228 | * |
| 229 | * <p>The Autofill Service must set supportsInlineSuggestions in its XML to enable support |
| 230 | * for inline suggestions.</p> |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 231 | * @hide |
| 232 | */ |
| 233 | @DataClass.Generated.Member |
| 234 | public FillRequest( |
| 235 | int id, |
| 236 | @NonNull List<FillContext> fillContexts, |
| 237 | @Nullable Bundle clientState, |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 238 | @RequestFlags int flags, |
| 239 | @Nullable InlineSuggestionsRequest inlineSuggestionsRequest) { |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 240 | this.mId = id; |
| 241 | this.mFillContexts = fillContexts; |
| 242 | com.android.internal.util.AnnotationValidations.validate( |
| 243 | NonNull.class, null, mFillContexts); |
| 244 | this.mClientState = clientState; |
| 245 | this.mFlags = flags; |
| 246 | |
| 247 | Preconditions.checkFlagsArgument( |
| 248 | mFlags, |
| 249 | FLAG_MANUAL_REQUEST |
Adam He | ef0fe208 | 2019-10-25 11:58:15 -0700 | [diff] [blame] | 250 | | FLAG_COMPATIBILITY_MODE_REQUEST |
| 251 | | FLAG_PASSWORD_INPUT_TYPE); |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 252 | this.mInlineSuggestionsRequest = inlineSuggestionsRequest; |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 253 | |
| 254 | onConstructed(); |
| 255 | } |
| 256 | |
| 257 | /** |
| 258 | * Gets the unique id of this request. |
| 259 | */ |
| 260 | @DataClass.Generated.Member |
| 261 | public int getId() { |
| 262 | return mId; |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 263 | } |
| 264 | |
| 265 | /** |
Felipe Leme | 2ef19c1 | 2017-06-05 11:32:32 -0700 | [diff] [blame] | 266 | * Gets the contexts associated with each previous fill request. |
Felipe Leme | c7ee7af | 2018-08-27 12:36:16 -0700 | [diff] [blame] | 267 | * |
| 268 | * <p><b>Note:</b> Starting on Android {@link android.os.Build.VERSION_CODES#Q}, it could also |
| 269 | * include contexts from requests whose {@link SaveInfo} had the |
| 270 | * {@link SaveInfo#FLAG_DELAY_SAVE} flag. |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 271 | */ |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 272 | @DataClass.Generated.Member |
Jeff Sharkey | 000ce80 | 2017-04-29 13:13:27 -0600 | [diff] [blame] | 273 | public @NonNull List<FillContext> getFillContexts() { |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 274 | return mFillContexts; |
Felipe Leme | a012d7e | 2017-09-06 15:19:11 -0700 | [diff] [blame] | 275 | } |
| 276 | |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 277 | /** |
Felipe Leme | d37f53e | 2017-12-07 10:41:10 -0800 | [diff] [blame] | 278 | * Gets the latest client state bundle set by the service in a |
| 279 | * {@link FillResponse.Builder#setClientState(Bundle) fill response}. |
Felipe Leme | 2ef19c1 | 2017-06-05 11:32:32 -0700 | [diff] [blame] | 280 | * |
Felipe Leme | d37f53e | 2017-12-07 10:41:10 -0800 | [diff] [blame] | 281 | * <p><b>Note:</b> Prior to Android {@link android.os.Build.VERSION_CODES#P}, only client state |
| 282 | * bundles set by {@link FillResponse.Builder#setClientState(Bundle)} were considered. On |
| 283 | * Android {@link android.os.Build.VERSION_CODES#P} and higher, bundles set in the result of |
| 284 | * an authenticated request through the |
| 285 | * {@link android.view.autofill.AutofillManager#EXTRA_CLIENT_STATE} extra are |
| 286 | * also considered (and take precedence when set). |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 287 | * |
| 288 | * @return The client state. |
| 289 | */ |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 290 | @DataClass.Generated.Member |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 291 | public @Nullable Bundle getClientState() { |
| 292 | return mClientState; |
| 293 | } |
| 294 | |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 295 | /** |
| 296 | * Gets the flags associated with this request. |
| 297 | * |
| 298 | * @return any combination of {@link #FLAG_MANUAL_REQUEST} and |
| 299 | * {@link #FLAG_COMPATIBILITY_MODE_REQUEST}. |
| 300 | */ |
| 301 | @DataClass.Generated.Member |
| 302 | public @RequestFlags int getFlags() { |
| 303 | return mFlags; |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 304 | } |
| 305 | |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 306 | /** |
Adam He | 045c020 | 2020-04-17 15:20:01 -0700 | [diff] [blame] | 307 | * Gets the {@link InlineSuggestionsRequest} associated |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 308 | * with this request. |
| 309 | * |
Adam He | 045c020 | 2020-04-17 15:20:01 -0700 | [diff] [blame] | 310 | * <p>Autofill Framework will send a {@code @non-null} {@link InlineSuggestionsRequest} if |
| 311 | * currently inline suggestions are supported and can be displayed. If the Autofill service |
| 312 | * wants to show inline suggestions, they may return {@link Dataset} with valid |
| 313 | * {@link InlinePresentation}.</p> |
| 314 | * |
| 315 | * <p>The Autofill Service must set supportsInlineSuggestions in its XML to enable support |
| 316 | * for inline suggestions.</p> |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 317 | * |
| 318 | * @return the suggestionspec |
| 319 | */ |
| 320 | @DataClass.Generated.Member |
| 321 | public @Nullable InlineSuggestionsRequest getInlineSuggestionsRequest() { |
| 322 | return mInlineSuggestionsRequest; |
| 323 | } |
| 324 | |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 325 | @Override |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 326 | @DataClass.Generated.Member |
| 327 | public String toString() { |
| 328 | // You can override field toString logic by defining methods like: |
| 329 | // String fieldNameToString() { ... } |
| 330 | |
| 331 | return "FillRequest { " + |
| 332 | "id = " + mId + ", " + |
| 333 | "fillContexts = " + mFillContexts + ", " + |
| 334 | "clientState = " + mClientState + ", " + |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 335 | "flags = " + requestFlagsToString(mFlags) + ", " + |
| 336 | "inlineSuggestionsRequest = " + mInlineSuggestionsRequest + |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 337 | " }"; |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 338 | } |
| 339 | |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 340 | @Override |
| 341 | @DataClass.Generated.Member |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 342 | public void writeToParcel(@NonNull Parcel dest, int flags) { |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 343 | // You can override field parcelling by defining methods like: |
| 344 | // void parcelFieldName(Parcel dest, int flags) { ... } |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 345 | |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 346 | byte flg = 0; |
| 347 | if (mClientState != null) flg |= 0x4; |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 348 | if (mInlineSuggestionsRequest != null) flg |= 0x10; |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 349 | dest.writeByte(flg); |
| 350 | dest.writeInt(mId); |
| 351 | dest.writeParcelableList(mFillContexts, flags); |
| 352 | if (mClientState != null) dest.writeBundle(mClientState); |
| 353 | dest.writeInt(mFlags); |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 354 | if (mInlineSuggestionsRequest != null) dest.writeTypedObject(mInlineSuggestionsRequest, flags); |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 355 | } |
| 356 | |
| 357 | @Override |
| 358 | @DataClass.Generated.Member |
| 359 | public int describeContents() { return 0; } |
| 360 | |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 361 | /** @hide */ |
| 362 | @SuppressWarnings({"unchecked", "RedundantCast"}) |
| 363 | @DataClass.Generated.Member |
| 364 | /* package-private */ FillRequest(@NonNull Parcel in) { |
| 365 | // You can override field unparcelling by defining methods like: |
| 366 | // static FieldType unparcelFieldName(Parcel in) { ... } |
| 367 | |
| 368 | byte flg = in.readByte(); |
| 369 | int id = in.readInt(); |
| 370 | List<FillContext> fillContexts = new ArrayList<>(); |
| 371 | in.readParcelableList(fillContexts, FillContext.class.getClassLoader()); |
| 372 | Bundle clientState = (flg & 0x4) == 0 ? null : in.readBundle(); |
| 373 | int flags = in.readInt(); |
| 374 | InlineSuggestionsRequest inlineSuggestionsRequest = (flg & 0x10) == 0 ? null : (InlineSuggestionsRequest) in.readTypedObject(InlineSuggestionsRequest.CREATOR); |
| 375 | |
| 376 | this.mId = id; |
| 377 | this.mFillContexts = fillContexts; |
| 378 | com.android.internal.util.AnnotationValidations.validate( |
| 379 | NonNull.class, null, mFillContexts); |
| 380 | this.mClientState = clientState; |
| 381 | this.mFlags = flags; |
| 382 | |
| 383 | Preconditions.checkFlagsArgument( |
| 384 | mFlags, |
| 385 | FLAG_MANUAL_REQUEST |
Adam He | ef0fe208 | 2019-10-25 11:58:15 -0700 | [diff] [blame] | 386 | | FLAG_COMPATIBILITY_MODE_REQUEST |
| 387 | | FLAG_PASSWORD_INPUT_TYPE); |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 388 | this.mInlineSuggestionsRequest = inlineSuggestionsRequest; |
| 389 | |
| 390 | onConstructed(); |
| 391 | } |
| 392 | |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 393 | @DataClass.Generated.Member |
| 394 | public static final @NonNull Parcelable.Creator<FillRequest> CREATOR |
| 395 | = new Parcelable.Creator<FillRequest>() { |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 396 | @Override |
| 397 | public FillRequest[] newArray(int size) { |
| 398 | return new FillRequest[size]; |
| 399 | } |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 400 | |
| 401 | @Override |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 402 | public FillRequest createFromParcel(@NonNull Parcel in) { |
| 403 | return new FillRequest(in); |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 404 | } |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 405 | }; |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 406 | |
| 407 | @DataClass.Generated( |
Adam He | 045c020 | 2020-04-17 15:20:01 -0700 | [diff] [blame] | 408 | time = 1588119440090L, |
| 409 | codegenVersion = "1.0.15", |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 410 | sourceFile = "frameworks/base/core/java/android/service/autofill/FillRequest.java", |
Adam He | ef0fe208 | 2019-10-25 11:58:15 -0700 | [diff] [blame] | 411 | inputSignatures = "public static final @android.service.autofill.FillRequest.RequestFlags int FLAG_MANUAL_REQUEST\npublic static final @android.service.autofill.FillRequest.RequestFlags int FLAG_COMPATIBILITY_MODE_REQUEST\npublic static final @android.service.autofill.FillRequest.RequestFlags int FLAG_PASSWORD_INPUT_TYPE\npublic static final int INVALID_REQUEST_ID\nprivate final int mId\nprivate final @android.annotation.NonNull java.util.List<android.service.autofill.FillContext> mFillContexts\nprivate final @android.annotation.Nullable android.os.Bundle mClientState\nprivate final @android.service.autofill.FillRequest.RequestFlags int mFlags\nprivate final @android.annotation.Nullable android.view.inputmethod.InlineSuggestionsRequest mInlineSuggestionsRequest\nprivate void onConstructed()\nclass FillRequest extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genHiddenConstructor=true, genHiddenConstDefs=true)") |
Eugene Susla | 3b2fe61 | 2019-08-06 18:47:14 -0700 | [diff] [blame] | 412 | @Deprecated |
| 413 | private void __metadata() {} |
| 414 | |
Adam He | bc67f2e | 2019-11-13 14:34:56 -0800 | [diff] [blame] | 415 | |
| 416 | //@formatter:on |
| 417 | // End of generated code |
| 418 | |
Svet Ganov | 013efe1 | 2017-04-13 21:56:16 -0700 | [diff] [blame] | 419 | } |