| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.service.autofill; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
import android.annotation.Nullable; |
| 21 |
import android.widget.RemoteViews; |
| 22 |
|
| 23 |
import com.android.internal.util.DataClass; |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
@DataClass(genBuilder = true) |
| 31 |
public final class Presentations { |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
private @Nullable RemoteViews mMenuPresentation; |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
private @Nullable InlinePresentation mInlinePresentation; |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
private @Nullable RemoteViews mDialogPresentation; |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
private @Nullable InlinePresentation mInlineTooltipPresentation; |
| 64 |
|
| 65 |
private static RemoteViews defaultMenuPresentation() { |
| 66 |
return null; |
| 67 |
} |
| 68 |
|
| 69 |
private static InlinePresentation defaultInlinePresentation() { |
| 70 |
return null; |
| 71 |
} |
| 72 |
|
| 73 |
private static RemoteViews defaultDialogPresentation() { |
| 74 |
return null; |
| 75 |
} |
| 76 |
|
| 77 |
private static InlinePresentation defaultInlineTooltipPresentation() { |
| 78 |
return null; |
| 79 |
} |
| 80 |
|
| 81 |
private void onConstructed() { |
| 82 |
if (mMenuPresentation == null |
| 83 |
&& mInlinePresentation == null |
| 84 |
&& mDialogPresentation == null) { |
| 85 |
throw new IllegalStateException("All presentations are null."); |
| 86 |
} |
| 87 |
if (mInlineTooltipPresentation != null && mInlinePresentation == null) { |
| 88 |
throw new IllegalStateException( |
| 89 |
"The inline presentation is required for mInlineTooltipPresentation."); |
| 90 |
} |
| 91 |
} |
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
@DataClass.Generated.Member |
| 109 |
Presentations( |
| 110 |
@Nullable RemoteViews menuPresentation, |
| 111 |
@Nullable InlinePresentation inlinePresentation, |
| 112 |
@Nullable RemoteViews dialogPresentation, |
| 113 |
@Nullable InlinePresentation inlineTooltipPresentation) { |
| 114 |
this.mMenuPresentation = menuPresentation; |
| 115 |
this.mInlinePresentation = inlinePresentation; |
| 116 |
this.mDialogPresentation = dialogPresentation; |
| 117 |
this.mInlineTooltipPresentation = inlineTooltipPresentation; |
| 118 |
|
| 119 |
onConstructed(); |
| 120 |
} |
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
@DataClass.Generated.Member |
| 129 |
public @Nullable RemoteViews getMenuPresentation() { |
| 130 |
return mMenuPresentation; |
| 131 |
} |
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
@DataClass.Generated.Member |
| 138 |
public @Nullable InlinePresentation getInlinePresentation() { |
| 139 |
return mInlinePresentation; |
| 140 |
} |
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
@DataClass.Generated.Member |
| 149 |
public @Nullable RemoteViews getDialogPresentation() { |
| 150 |
return mDialogPresentation; |
| 151 |
} |
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
@DataClass.Generated.Member |
| 159 |
public @Nullable InlinePresentation getInlineTooltipPresentation() { |
| 160 |
return mInlineTooltipPresentation; |
| 161 |
} |
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
@SuppressWarnings("WeakerAccess") |
| 167 |
@DataClass.Generated.Member |
| 168 |
public static final class Builder { |
| 169 |
|
| 170 |
private @Nullable RemoteViews mMenuPresentation; |
| 171 |
private @Nullable InlinePresentation mInlinePresentation; |
| 172 |
private @Nullable RemoteViews mDialogPresentation; |
| 173 |
private @Nullable InlinePresentation mInlineTooltipPresentation; |
| 174 |
|
| 175 |
private long mBuilderFieldsSet = 0L; |
| 176 |
|
| 177 |
public Builder() { |
| 178 |
} |
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
@DataClass.Generated.Member |
| 187 |
public @NonNull Builder setMenuPresentation(@NonNull RemoteViews value) { |
| 188 |
checkNotUsed(); |
| 189 |
mBuilderFieldsSet |= 0x1; |
| 190 |
mMenuPresentation = value; |
| 191 |
return this; |
| 192 |
} |
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
@DataClass.Generated.Member |
| 199 |
public @NonNull Builder setInlinePresentation(@NonNull InlinePresentation value) { |
| 200 |
checkNotUsed(); |
| 201 |
mBuilderFieldsSet |= 0x2; |
| 202 |
mInlinePresentation = value; |
| 203 |
return this; |
| 204 |
} |
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
@DataClass.Generated.Member |
| 213 |
public @NonNull Builder setDialogPresentation(@NonNull RemoteViews value) { |
| 214 |
checkNotUsed(); |
| 215 |
mBuilderFieldsSet |= 0x4; |
| 216 |
mDialogPresentation = value; |
| 217 |
return this; |
| 218 |
} |
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
@DataClass.Generated.Member |
| 226 |
public @NonNull Builder setInlineTooltipPresentation(@NonNull InlinePresentation value) { |
| 227 |
checkNotUsed(); |
| 228 |
mBuilderFieldsSet |= 0x8; |
| 229 |
mInlineTooltipPresentation = value; |
| 230 |
return this; |
| 231 |
} |
| 232 |
|
| 233 |
|
| 234 |
public @NonNull Presentations build() { |
| 235 |
checkNotUsed(); |
| 236 |
mBuilderFieldsSet |= 0x10; |
| 237 |
|
| 238 |
if ((mBuilderFieldsSet & 0x1) == 0) { |
| 239 |
mMenuPresentation = defaultMenuPresentation(); |
| 240 |
} |
| 241 |
if ((mBuilderFieldsSet & 0x2) == 0) { |
| 242 |
mInlinePresentation = defaultInlinePresentation(); |
| 243 |
} |
| 244 |
if ((mBuilderFieldsSet & 0x4) == 0) { |
| 245 |
mDialogPresentation = defaultDialogPresentation(); |
| 246 |
} |
| 247 |
if ((mBuilderFieldsSet & 0x8) == 0) { |
| 248 |
mInlineTooltipPresentation = defaultInlineTooltipPresentation(); |
| 249 |
} |
| 250 |
Presentations o = new Presentations( |
| 251 |
mMenuPresentation, |
| 252 |
mInlinePresentation, |
| 253 |
mDialogPresentation, |
| 254 |
mInlineTooltipPresentation); |
| 255 |
return o; |
| 256 |
} |
| 257 |
|
| 258 |
private void checkNotUsed() { |
| 259 |
if ((mBuilderFieldsSet & 0x10) != 0) { |
| 260 |
throw new IllegalStateException( |
| 261 |
"This Builder should not be reused. Use a new Builder instance instead"); |
| 262 |
} |
| 263 |
} |
| 264 |
} |
| 265 |
|
| 266 |
@DataClass.Generated( |
| 267 |
time = 1643083242164L, |
| 268 |
codegenVersion = "1.0.23", |
| 269 |
sourceFile = "frameworks/base/core/java/android/service/autofill/Presentations.java", |
| 270 |
inputSignatures = "private @android.annotation.Nullable android.widget.RemoteViews mMenuPresentation\nprivate @android.annotation.Nullable android.service.autofill.InlinePresentation mInlinePresentation\nprivate @android.annotation.Nullable android.widget.RemoteViews mDialogPresentation\nprivate @android.annotation.Nullable android.service.autofill.InlinePresentation mInlineTooltipPresentation\nprivate static android.widget.RemoteViews defaultMenuPresentation()\nprivate static android.service.autofill.InlinePresentation defaultInlinePresentation()\nprivate static android.widget.RemoteViews defaultDialogPresentation()\nprivate static android.service.autofill.InlinePresentation defaultInlineTooltipPresentation()\nprivate void onConstructed()\nclass Presentations extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genBuilder=true)") |
| 271 |
@Deprecated |
| 272 |
private void __metadata() {} |
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
} |