1 /*
2  * Copyright (C) 2022 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 com.android.internal.pm.pkg.component;
18 
19 import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZEABLE;
20 import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE;
21 import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION;
22 import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
23 import static android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_UNSPECIFIED;
24 
25 import static com.android.internal.pm.parsing.pkg.PackageImpl.sForInternedString;
26 import static com.android.internal.pm.parsing.pkg.PackageImpl.sForStringSet;
27 
28 import android.annotation.NonNull;
29 import android.annotation.Nullable;
30 import android.app.ActivityTaskManager;
31 import android.content.ComponentName;
32 import android.content.pm.ActivityInfo;
33 import android.content.pm.PackageManager;
34 import android.os.Parcel;
35 import android.os.Parcelable;
36 import android.text.TextUtils;
37 import android.util.ArraySet;
38 
39 import com.android.internal.pm.pkg.parsing.ParsingUtils;
40 import com.android.internal.util.DataClass;
41 import com.android.internal.util.Parcelling.BuiltIn.ForInternedString;
42 
43 import java.util.Collections;
44 import java.util.Locale;
45 import java.util.Set;
46 
47 /**
48  * @hide
49  **/
50 @DataClass(genGetters = true, genSetters = true, genBuilder = false, genParcelable = false)
51 public class ParsedActivityImpl extends ParsedMainComponentImpl implements ParsedActivity,
52         Parcelable {
53 
54     private int theme;
55     private int uiOptions;
56 
57     @Nullable
58     @DataClass.ParcelWith(ForInternedString.class)
59     private String targetActivity;
60 
61     @Nullable
62     @DataClass.ParcelWith(ForInternedString.class)
63     private String parentActivityName;
64     @Nullable
65     private String taskAffinity;
66     private int privateFlags;
67     @Nullable
68     @DataClass.ParcelWith(ForInternedString.class)
69     private String permission;
70     @Nullable
71     private Set<String> mKnownActivityEmbeddingCerts;
72 
73     private int launchMode;
74     private int documentLaunchMode;
75     private int maxRecents;
76     private int configChanges;
77     private int softInputMode;
78     private int persistableMode;
79     private int lockTaskLaunchMode;
80 
81     private int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
82     private int resizeMode = ActivityInfo.RESIZE_MODE_RESIZEABLE;
83 
84     private float maxAspectRatio = ParsingUtils.NOT_SET;
85     private float minAspectRatio = ParsingUtils.NOT_SET;
86 
87     private boolean supportsSizeChanges;
88 
89     @Nullable
90     private String requestedVrComponent;
91     private int rotationAnimation = -1;
92     private int colorMode;
93 
94     @Nullable
95     private ActivityInfo.WindowLayout windowLayout;
96 
97     @Nullable
98     private String mRequiredDisplayCategory;
99 
100     private int mRequireContentUriPermissionFromCaller;
101 
ParsedActivityImpl(ParsedActivityImpl other)102     public ParsedActivityImpl(ParsedActivityImpl other) {
103         super(other);
104         this.theme = other.theme;
105         this.uiOptions = other.uiOptions;
106         this.targetActivity = other.targetActivity;
107         this.parentActivityName = other.parentActivityName;
108         this.taskAffinity = other.taskAffinity;
109         this.privateFlags = other.privateFlags;
110         this.permission = other.permission;
111         this.launchMode = other.launchMode;
112         this.documentLaunchMode = other.documentLaunchMode;
113         this.maxRecents = other.maxRecents;
114         this.configChanges = other.configChanges;
115         this.softInputMode = other.softInputMode;
116         this.persistableMode = other.persistableMode;
117         this.lockTaskLaunchMode = other.lockTaskLaunchMode;
118         this.screenOrientation = other.screenOrientation;
119         this.resizeMode = other.resizeMode;
120         this.maxAspectRatio = other.maxAspectRatio;
121         this.minAspectRatio = other.minAspectRatio;
122         this.supportsSizeChanges = other.supportsSizeChanges;
123         this.requestedVrComponent = other.requestedVrComponent;
124         this.rotationAnimation = other.rotationAnimation;
125         this.colorMode = other.colorMode;
126         this.windowLayout = other.windowLayout;
127         this.mKnownActivityEmbeddingCerts = other.mKnownActivityEmbeddingCerts;
128         this.mRequiredDisplayCategory = other.mRequiredDisplayCategory;
129         this.mRequireContentUriPermissionFromCaller = other.mRequireContentUriPermissionFromCaller;
130     }
131 
132     /**
133      * Generate activity object that forwards user to App Details page automatically. This activity
134      * should be invisible to user and user should not know or see it.
135      */
136     @NonNull
makeAppDetailsActivity(String packageName, String processName, int uiOptions, String taskAffinity, boolean hardwareAccelerated)137     public static ParsedActivityImpl makeAppDetailsActivity(String packageName, String processName,
138             int uiOptions, String taskAffinity, boolean hardwareAccelerated) {
139         ParsedActivityImpl activity = new ParsedActivityImpl();
140         activity.setPackageName(packageName);
141         activity.theme = android.R.style.Theme_NoDisplay;
142         activity.setExported(true);
143         activity.setName(PackageManager.APP_DETAILS_ACTIVITY_CLASS_NAME);
144         activity.setProcessName(processName);
145         activity.uiOptions = uiOptions;
146         activity.taskAffinity = taskAffinity;
147         activity.launchMode = ActivityInfo.LAUNCH_MULTIPLE;
148         activity.documentLaunchMode = ActivityInfo.DOCUMENT_LAUNCH_NONE;
149         activity.maxRecents = ActivityTaskManager.getDefaultAppRecentsLimitStatic();
150         activity.configChanges = ParsedActivityUtils.getActivityConfigChanges(0, 0);
151         activity.softInputMode = 0;
152         activity.persistableMode = ActivityInfo.PERSIST_NEVER;
153         activity.screenOrientation = SCREEN_ORIENTATION_UNSPECIFIED;
154         activity.resizeMode = RESIZE_MODE_FORCE_RESIZEABLE;
155         activity.lockTaskLaunchMode = 0;
156         activity.setDirectBootAware(false);
157         activity.rotationAnimation = ROTATION_ANIMATION_UNSPECIFIED;
158         activity.colorMode = ActivityInfo.COLOR_MODE_DEFAULT;
159         if (hardwareAccelerated) {
160             activity.setFlags(activity.getFlags() | ActivityInfo.FLAG_HARDWARE_ACCELERATED);
161         }
162         return activity;
163     }
164 
165     @NonNull
makeAlias(String targetActivityName, ParsedActivity target)166     static ParsedActivityImpl makeAlias(String targetActivityName, ParsedActivity target) {
167         ParsedActivityImpl alias = new ParsedActivityImpl();
168         alias.setPackageName(target.getPackageName());
169         alias.setTargetActivity(targetActivityName);
170         alias.configChanges = target.getConfigChanges();
171         alias.setFlags(target.getFlags());
172         alias.privateFlags = target.getPrivateFlags();
173         alias.setIcon(target.getIcon());
174         alias.setLogo(target.getLogo());
175         alias.setBanner(target.getBanner());
176         alias.setLabelRes(target.getLabelRes());
177         alias.setNonLocalizedLabel(target.getNonLocalizedLabel());
178         alias.launchMode = target.getLaunchMode();
179         alias.lockTaskLaunchMode = target.getLockTaskLaunchMode();
180         alias.documentLaunchMode = target.getDocumentLaunchMode();
181         alias.setDescriptionRes(target.getDescriptionRes());
182         alias.screenOrientation = target.getScreenOrientation();
183         alias.taskAffinity = target.getTaskAffinity();
184         alias.theme = target.getTheme();
185         alias.softInputMode = target.getSoftInputMode();
186         alias.uiOptions = target.getUiOptions();
187         alias.parentActivityName = target.getParentActivityName();
188         alias.maxRecents = target.getMaxRecents();
189         alias.windowLayout = target.getWindowLayout();
190         alias.resizeMode = target.getResizeMode();
191         alias.maxAspectRatio = target.getMaxAspectRatio();
192         alias.minAspectRatio = target.getMinAspectRatio();
193         alias.supportsSizeChanges = target.isSupportsSizeChanges();
194         alias.requestedVrComponent = target.getRequestedVrComponent();
195         alias.setDirectBootAware(target.isDirectBootAware());
196         alias.setProcessName(target.getProcessName());
197         alias.setRequiredDisplayCategory(target.getRequiredDisplayCategory());
198         alias.setRequireContentUriPermissionFromCaller(
199                 target.getRequireContentUriPermissionFromCaller());
200         return alias;
201 
202         // Not all attributes from the target ParsedActivity are copied to the alias.
203         // Careful when adding an attribute and determine whether or not it should be copied.
204 //        alias.enabled = target.enabled;
205 //        alias.exported = target.exported;
206 //        alias.permission = target.permission;
207 //        alias.splitName = target.splitName;
208 //        alias.persistableMode = target.persistableMode;
209 //        alias.rotationAnimation = target.rotationAnimation;
210 //        alias.colorMode = target.colorMode;
211 //        alias.intents.addAll(target.intents);
212 //        alias.order = target.order;
213 //        alias.metaData = target.metaData;
214     }
215 
setMaxAspectRatio(int resizeMode, float maxAspectRatio)216     public ParsedActivityImpl setMaxAspectRatio(int resizeMode, float maxAspectRatio) {
217         if (resizeMode == ActivityInfo.RESIZE_MODE_RESIZEABLE
218                 || resizeMode == ActivityInfo.RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION) {
219             // Resizeable activities can be put in any aspect ratio.
220             return this;
221         }
222 
223         if (maxAspectRatio < 1.0f && maxAspectRatio != 0) {
224             // Ignore any value lesser than 1.0.
225             return this;
226         }
227 
228         this.maxAspectRatio = maxAspectRatio;
229         return this;
230     }
231 
setMinAspectRatio(int resizeMode, float minAspectRatio)232     public ParsedActivityImpl setMinAspectRatio(int resizeMode, float minAspectRatio) {
233         if (resizeMode == RESIZE_MODE_RESIZEABLE
234                 || resizeMode == RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION) {
235             // Resizeable activities can be put in any aspect ratio.
236             return this;
237         }
238 
239         if (minAspectRatio < 1.0f && minAspectRatio != 0) {
240             // Ignore any value lesser than 1.0.
241             return this;
242         }
243 
244         this.minAspectRatio = minAspectRatio;
245         return this;
246     }
247 
setTargetActivity(String targetActivity)248     public ParsedActivityImpl setTargetActivity(String targetActivity) {
249         this.targetActivity = TextUtils.safeIntern(targetActivity);
250         return this;
251     }
252 
setPermission(String permission)253     public ParsedActivityImpl setPermission(String permission) {
254         // Empty string must be converted to null
255         this.permission = TextUtils.isEmpty(permission) ? null : permission.intern();
256         return this;
257     }
258 
259     @NonNull
260     @Override
getKnownActivityEmbeddingCerts()261     public Set<String> getKnownActivityEmbeddingCerts() {
262         return mKnownActivityEmbeddingCerts == null ? Collections.emptySet()
263                 : mKnownActivityEmbeddingCerts;
264     }
265 
266     /**
267      * Sets the trusted host certificates of apps that are allowed to embed this activity.
268      */
setKnownActivityEmbeddingCerts(@onNull Set<String> knownActivityEmbeddingCerts)269     public void setKnownActivityEmbeddingCerts(@NonNull Set<String> knownActivityEmbeddingCerts) {
270         // Convert the provided digest to upper case for consistent Set membership
271         // checks when verifying the signing certificate digests of requesting apps.
272         this.mKnownActivityEmbeddingCerts = new ArraySet<>();
273         for (String knownCert : knownActivityEmbeddingCerts) {
274             this.mKnownActivityEmbeddingCerts.add(knownCert.toUpperCase(Locale.US));
275         }
276     }
277 
toString()278     public String toString() {
279         StringBuilder sb = new StringBuilder(128);
280         sb.append("Activity{");
281         sb.append(Integer.toHexString(System.identityHashCode(this)));
282         sb.append(' ');
283         ComponentName.appendShortString(sb, getPackageName(), getName());
284         sb.append('}');
285         return sb.toString();
286     }
287 
288     @Override
describeContents()289     public int describeContents() {
290         return 0;
291     }
292 
293     @Override
writeToParcel(Parcel dest, int flags)294     public void writeToParcel(Parcel dest, int flags) {
295         super.writeToParcel(dest, flags);
296         dest.writeInt(this.theme);
297         dest.writeInt(this.uiOptions);
298         dest.writeString(this.targetActivity);
299         dest.writeString(this.parentActivityName);
300         dest.writeString(this.taskAffinity);
301         dest.writeInt(this.privateFlags);
302         sForInternedString.parcel(this.permission, dest, flags);
303         dest.writeInt(this.launchMode);
304         dest.writeInt(this.documentLaunchMode);
305         dest.writeInt(this.maxRecents);
306         dest.writeInt(this.configChanges);
307         dest.writeInt(this.softInputMode);
308         dest.writeInt(this.persistableMode);
309         dest.writeInt(this.lockTaskLaunchMode);
310         dest.writeInt(this.screenOrientation);
311         dest.writeInt(this.resizeMode);
312         dest.writeValue(this.maxAspectRatio);
313         dest.writeValue(this.minAspectRatio);
314         dest.writeBoolean(this.supportsSizeChanges);
315         dest.writeString(this.requestedVrComponent);
316         dest.writeInt(this.rotationAnimation);
317         dest.writeInt(this.colorMode);
318         dest.writeBundle(this.getMetaData());
319 
320         if (windowLayout != null) {
321             dest.writeInt(1);
322             windowLayout.writeToParcel(dest);
323         } else {
324             dest.writeBoolean(false);
325         }
326         sForStringSet.parcel(this.mKnownActivityEmbeddingCerts, dest, flags);
327         dest.writeString8(this.mRequiredDisplayCategory);
328         dest.writeInt(this.mRequireContentUriPermissionFromCaller);
329     }
330 
ParsedActivityImpl()331     public ParsedActivityImpl() {
332     }
333 
ParsedActivityImpl(Parcel in)334     protected ParsedActivityImpl(Parcel in) {
335         super(in);
336         this.theme = in.readInt();
337         this.uiOptions = in.readInt();
338         this.targetActivity = in.readString();
339         this.parentActivityName = in.readString();
340         this.taskAffinity = in.readString();
341         this.privateFlags = in.readInt();
342         this.permission = sForInternedString.unparcel(in);
343         this.launchMode = in.readInt();
344         this.documentLaunchMode = in.readInt();
345         this.maxRecents = in.readInt();
346         this.configChanges = in.readInt();
347         this.softInputMode = in.readInt();
348         this.persistableMode = in.readInt();
349         this.lockTaskLaunchMode = in.readInt();
350         this.screenOrientation = in.readInt();
351         this.resizeMode = in.readInt();
352         this.maxAspectRatio = (Float) in.readValue(Float.class.getClassLoader());
353         this.minAspectRatio = (Float) in.readValue(Float.class.getClassLoader());
354         this.supportsSizeChanges = in.readBoolean();
355         this.requestedVrComponent = in.readString();
356         this.rotationAnimation = in.readInt();
357         this.colorMode = in.readInt();
358         this.setMetaData(in.readBundle());
359         if (in.readBoolean()) {
360             windowLayout = new ActivityInfo.WindowLayout(in);
361         }
362         this.mKnownActivityEmbeddingCerts = sForStringSet.unparcel(in);
363         this.mRequiredDisplayCategory = in.readString8();
364         this.mRequireContentUriPermissionFromCaller = in.readInt();
365     }
366 
367     @NonNull
368     public static final Parcelable.Creator<ParsedActivityImpl> CREATOR =
369             new Parcelable.Creator<ParsedActivityImpl>() {
370         @Override
371         public ParsedActivityImpl createFromParcel(Parcel source) {
372             return new ParsedActivityImpl(source);
373         }
374 
375         @Override
376         public ParsedActivityImpl[] newArray(int size) {
377             return new ParsedActivityImpl[size];
378         }
379     };
380 
381 
382 
383     // Code below generated by codegen v1.0.23.
384     //
385     // DO NOT MODIFY!
386     // CHECKSTYLE:OFF Generated code
387     //
388     // To regenerate run:
389     // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/com/android/internal/pm/pkg/component/ParsedActivityImpl.java
390     //
391     // To exclude the generated code from IntelliJ auto-formatting enable (one-time):
392     //   Settings > Editor > Code Style > Formatter Control
393     //@formatter:off
394 
395 
396     @DataClass.Generated.Member
ParsedActivityImpl( int theme, int uiOptions, @Nullable String targetActivity, @Nullable String parentActivityName, @Nullable String taskAffinity, int privateFlags, @Nullable String permission, @Nullable Set<String> knownActivityEmbeddingCerts, int launchMode, int documentLaunchMode, int maxRecents, int configChanges, int softInputMode, int persistableMode, int lockTaskLaunchMode, int screenOrientation, int resizeMode, float maxAspectRatio, float minAspectRatio, boolean supportsSizeChanges, @Nullable String requestedVrComponent, int rotationAnimation, int colorMode, @Nullable ActivityInfo.WindowLayout windowLayout, @Nullable String requiredDisplayCategory, int requireContentUriPermissionFromCaller)397     public ParsedActivityImpl(
398             int theme,
399             int uiOptions,
400             @Nullable String targetActivity,
401             @Nullable String parentActivityName,
402             @Nullable String taskAffinity,
403             int privateFlags,
404             @Nullable String permission,
405             @Nullable Set<String> knownActivityEmbeddingCerts,
406             int launchMode,
407             int documentLaunchMode,
408             int maxRecents,
409             int configChanges,
410             int softInputMode,
411             int persistableMode,
412             int lockTaskLaunchMode,
413             int screenOrientation,
414             int resizeMode,
415             float maxAspectRatio,
416             float minAspectRatio,
417             boolean supportsSizeChanges,
418             @Nullable String requestedVrComponent,
419             int rotationAnimation,
420             int colorMode,
421             @Nullable ActivityInfo.WindowLayout windowLayout,
422             @Nullable String requiredDisplayCategory,
423             int requireContentUriPermissionFromCaller) {
424         this.theme = theme;
425         this.uiOptions = uiOptions;
426         this.targetActivity = targetActivity;
427         this.parentActivityName = parentActivityName;
428         this.taskAffinity = taskAffinity;
429         this.privateFlags = privateFlags;
430         this.permission = permission;
431         this.mKnownActivityEmbeddingCerts = knownActivityEmbeddingCerts;
432         this.launchMode = launchMode;
433         this.documentLaunchMode = documentLaunchMode;
434         this.maxRecents = maxRecents;
435         this.configChanges = configChanges;
436         this.softInputMode = softInputMode;
437         this.persistableMode = persistableMode;
438         this.lockTaskLaunchMode = lockTaskLaunchMode;
439         this.screenOrientation = screenOrientation;
440         this.resizeMode = resizeMode;
441         this.maxAspectRatio = maxAspectRatio;
442         this.minAspectRatio = minAspectRatio;
443         this.supportsSizeChanges = supportsSizeChanges;
444         this.requestedVrComponent = requestedVrComponent;
445         this.rotationAnimation = rotationAnimation;
446         this.colorMode = colorMode;
447         this.windowLayout = windowLayout;
448         this.mRequiredDisplayCategory = requiredDisplayCategory;
449         this.mRequireContentUriPermissionFromCaller = requireContentUriPermissionFromCaller;
450 
451         // onConstructed(); // You can define this method to get a callback
452     }
453 
454     @DataClass.Generated.Member
getTheme()455     public int getTheme() {
456         return theme;
457     }
458 
459     @DataClass.Generated.Member
getUiOptions()460     public int getUiOptions() {
461         return uiOptions;
462     }
463 
464     @DataClass.Generated.Member
getTargetActivity()465     public @Nullable String getTargetActivity() {
466         return targetActivity;
467     }
468 
469     @DataClass.Generated.Member
getParentActivityName()470     public @Nullable String getParentActivityName() {
471         return parentActivityName;
472     }
473 
474     @DataClass.Generated.Member
getTaskAffinity()475     public @Nullable String getTaskAffinity() {
476         return taskAffinity;
477     }
478 
479     @DataClass.Generated.Member
getPrivateFlags()480     public int getPrivateFlags() {
481         return privateFlags;
482     }
483 
484     @DataClass.Generated.Member
getPermission()485     public @Nullable String getPermission() {
486         return permission;
487     }
488 
489     @DataClass.Generated.Member
getLaunchMode()490     public int getLaunchMode() {
491         return launchMode;
492     }
493 
494     @DataClass.Generated.Member
getDocumentLaunchMode()495     public int getDocumentLaunchMode() {
496         return documentLaunchMode;
497     }
498 
499     @DataClass.Generated.Member
getMaxRecents()500     public int getMaxRecents() {
501         return maxRecents;
502     }
503 
504     @DataClass.Generated.Member
getConfigChanges()505     public int getConfigChanges() {
506         return configChanges;
507     }
508 
509     @DataClass.Generated.Member
getSoftInputMode()510     public int getSoftInputMode() {
511         return softInputMode;
512     }
513 
514     @DataClass.Generated.Member
getPersistableMode()515     public int getPersistableMode() {
516         return persistableMode;
517     }
518 
519     @DataClass.Generated.Member
getLockTaskLaunchMode()520     public int getLockTaskLaunchMode() {
521         return lockTaskLaunchMode;
522     }
523 
524     @DataClass.Generated.Member
getScreenOrientation()525     public int getScreenOrientation() {
526         return screenOrientation;
527     }
528 
529     @DataClass.Generated.Member
getResizeMode()530     public int getResizeMode() {
531         return resizeMode;
532     }
533 
534     @DataClass.Generated.Member
getMaxAspectRatio()535     public float getMaxAspectRatio() {
536         return maxAspectRatio;
537     }
538 
539     @DataClass.Generated.Member
getMinAspectRatio()540     public float getMinAspectRatio() {
541         return minAspectRatio;
542     }
543 
544     @DataClass.Generated.Member
isSupportsSizeChanges()545     public boolean isSupportsSizeChanges() {
546         return supportsSizeChanges;
547     }
548 
549     @DataClass.Generated.Member
getRequestedVrComponent()550     public @Nullable String getRequestedVrComponent() {
551         return requestedVrComponent;
552     }
553 
554     @DataClass.Generated.Member
getRotationAnimation()555     public int getRotationAnimation() {
556         return rotationAnimation;
557     }
558 
559     @DataClass.Generated.Member
getColorMode()560     public int getColorMode() {
561         return colorMode;
562     }
563 
564     @DataClass.Generated.Member
getWindowLayout()565     public @Nullable ActivityInfo.WindowLayout getWindowLayout() {
566         return windowLayout;
567     }
568 
569     @DataClass.Generated.Member
getRequiredDisplayCategory()570     public @Nullable String getRequiredDisplayCategory() {
571         return mRequiredDisplayCategory;
572     }
573 
574     @DataClass.Generated.Member
getRequireContentUriPermissionFromCaller()575     public int getRequireContentUriPermissionFromCaller() {
576         return mRequireContentUriPermissionFromCaller;
577     }
578 
579     @DataClass.Generated.Member
setTheme( int value)580     public @NonNull ParsedActivityImpl setTheme( int value) {
581         theme = value;
582         return this;
583     }
584 
585     @DataClass.Generated.Member
setUiOptions( int value)586     public @NonNull ParsedActivityImpl setUiOptions( int value) {
587         uiOptions = value;
588         return this;
589     }
590 
591     @DataClass.Generated.Member
setParentActivityName(@onNull String value)592     public @NonNull ParsedActivityImpl setParentActivityName(@NonNull String value) {
593         parentActivityName = value;
594         return this;
595     }
596 
597     @DataClass.Generated.Member
setTaskAffinity(@onNull String value)598     public @NonNull ParsedActivityImpl setTaskAffinity(@NonNull String value) {
599         taskAffinity = value;
600         return this;
601     }
602 
603     @DataClass.Generated.Member
setPrivateFlags( int value)604     public @NonNull ParsedActivityImpl setPrivateFlags( int value) {
605         privateFlags = value;
606         return this;
607     }
608 
609     @DataClass.Generated.Member
setLaunchMode( int value)610     public @NonNull ParsedActivityImpl setLaunchMode( int value) {
611         launchMode = value;
612         return this;
613     }
614 
615     @DataClass.Generated.Member
setDocumentLaunchMode( int value)616     public @NonNull ParsedActivityImpl setDocumentLaunchMode( int value) {
617         documentLaunchMode = value;
618         return this;
619     }
620 
621     @DataClass.Generated.Member
setMaxRecents( int value)622     public @NonNull ParsedActivityImpl setMaxRecents( int value) {
623         maxRecents = value;
624         return this;
625     }
626 
627     @DataClass.Generated.Member
setConfigChanges( int value)628     public @NonNull ParsedActivityImpl setConfigChanges( int value) {
629         configChanges = value;
630         return this;
631     }
632 
633     @DataClass.Generated.Member
setSoftInputMode( int value)634     public @NonNull ParsedActivityImpl setSoftInputMode( int value) {
635         softInputMode = value;
636         return this;
637     }
638 
639     @DataClass.Generated.Member
setPersistableMode( int value)640     public @NonNull ParsedActivityImpl setPersistableMode( int value) {
641         persistableMode = value;
642         return this;
643     }
644 
645     @DataClass.Generated.Member
setLockTaskLaunchMode( int value)646     public @NonNull ParsedActivityImpl setLockTaskLaunchMode( int value) {
647         lockTaskLaunchMode = value;
648         return this;
649     }
650 
651     @DataClass.Generated.Member
setScreenOrientation( int value)652     public @NonNull ParsedActivityImpl setScreenOrientation( int value) {
653         screenOrientation = value;
654         return this;
655     }
656 
657     @DataClass.Generated.Member
setResizeMode( int value)658     public @NonNull ParsedActivityImpl setResizeMode( int value) {
659         resizeMode = value;
660         return this;
661     }
662 
663     @DataClass.Generated.Member
setMaxAspectRatio( float value)664     public @NonNull ParsedActivityImpl setMaxAspectRatio( float value) {
665         maxAspectRatio = value;
666         return this;
667     }
668 
669     @DataClass.Generated.Member
setMinAspectRatio( float value)670     public @NonNull ParsedActivityImpl setMinAspectRatio( float value) {
671         minAspectRatio = value;
672         return this;
673     }
674 
675     @DataClass.Generated.Member
setSupportsSizeChanges( boolean value)676     public @NonNull ParsedActivityImpl setSupportsSizeChanges( boolean value) {
677         supportsSizeChanges = value;
678         return this;
679     }
680 
681     @DataClass.Generated.Member
setRequestedVrComponent(@onNull String value)682     public @NonNull ParsedActivityImpl setRequestedVrComponent(@NonNull String value) {
683         requestedVrComponent = value;
684         return this;
685     }
686 
687     @DataClass.Generated.Member
setRotationAnimation( int value)688     public @NonNull ParsedActivityImpl setRotationAnimation( int value) {
689         rotationAnimation = value;
690         return this;
691     }
692 
693     @DataClass.Generated.Member
setColorMode( int value)694     public @NonNull ParsedActivityImpl setColorMode( int value) {
695         colorMode = value;
696         return this;
697     }
698 
699     @DataClass.Generated.Member
setWindowLayout(@onNull ActivityInfo.WindowLayout value)700     public @NonNull ParsedActivityImpl setWindowLayout(@NonNull ActivityInfo.WindowLayout value) {
701         windowLayout = value;
702         return this;
703     }
704 
705     @DataClass.Generated.Member
setRequiredDisplayCategory(@onNull String value)706     public @NonNull ParsedActivityImpl setRequiredDisplayCategory(@NonNull String value) {
707         mRequiredDisplayCategory = value;
708         return this;
709     }
710 
711     @DataClass.Generated.Member
setRequireContentUriPermissionFromCaller( int value)712     public @NonNull ParsedActivityImpl setRequireContentUriPermissionFromCaller( int value) {
713         mRequireContentUriPermissionFromCaller = value;
714         return this;
715     }
716 
717     @DataClass.Generated(
718             time = 1706180262165L,
719             codegenVersion = "1.0.23",
720             sourceFile = "frameworks/base/core/java/com/android/internal/pm/pkg/component/ParsedActivityImpl.java",
721             inputSignatures = "private  int theme\nprivate  int uiOptions\nprivate @android.annotation.Nullable @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForInternedString.class) java.lang.String targetActivity\nprivate @android.annotation.Nullable @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForInternedString.class) java.lang.String parentActivityName\nprivate @android.annotation.Nullable java.lang.String taskAffinity\nprivate  int privateFlags\nprivate @android.annotation.Nullable @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForInternedString.class) java.lang.String permission\nprivate @android.annotation.Nullable java.util.Set<java.lang.String> mKnownActivityEmbeddingCerts\nprivate  int launchMode\nprivate  int documentLaunchMode\nprivate  int maxRecents\nprivate  int configChanges\nprivate  int softInputMode\nprivate  int persistableMode\nprivate  int lockTaskLaunchMode\nprivate  int screenOrientation\nprivate  int resizeMode\nprivate  float maxAspectRatio\nprivate  float minAspectRatio\nprivate  boolean supportsSizeChanges\nprivate @android.annotation.Nullable java.lang.String requestedVrComponent\nprivate  int rotationAnimation\nprivate  int colorMode\nprivate @android.annotation.Nullable android.content.pm.ActivityInfo.WindowLayout windowLayout\nprivate @android.annotation.Nullable java.lang.String mRequiredDisplayCategory\nprivate  int mRequireContentUriPermissionFromCaller\npublic static final @android.annotation.NonNull android.os.Parcelable.Creator<com.android.internal.pm.pkg.component.ParsedActivityImpl> CREATOR\npublic static @android.annotation.NonNull com.android.internal.pm.pkg.component.ParsedActivityImpl makeAppDetailsActivity(java.lang.String,java.lang.String,int,java.lang.String,boolean)\nstatic @android.annotation.NonNull com.android.internal.pm.pkg.component.ParsedActivityImpl makeAlias(java.lang.String,com.android.internal.pm.pkg.component.ParsedActivity)\npublic  com.android.internal.pm.pkg.component.ParsedActivityImpl setMaxAspectRatio(int,float)\npublic  com.android.internal.pm.pkg.component.ParsedActivityImpl setMinAspectRatio(int,float)\npublic  com.android.internal.pm.pkg.component.ParsedActivityImpl setTargetActivity(java.lang.String)\npublic  com.android.internal.pm.pkg.component.ParsedActivityImpl setPermission(java.lang.String)\npublic @android.annotation.NonNull @java.lang.Override java.util.Set<java.lang.String> getKnownActivityEmbeddingCerts()\npublic  void setKnownActivityEmbeddingCerts(java.util.Set<java.lang.String>)\npublic  java.lang.String toString()\npublic @java.lang.Override int describeContents()\npublic @java.lang.Override void writeToParcel(android.os.Parcel,int)\nclass ParsedActivityImpl extends com.android.internal.pm.pkg.component.ParsedMainComponentImpl implements [com.android.internal.pm.pkg.component.ParsedActivity, android.os.Parcelable]\n@com.android.internal.util.DataClass(genGetters=true, genSetters=true, genBuilder=false, genParcelable=false)")
722     @Deprecated
__metadata()723     private void __metadata() {}
724 
725 
726     //@formatter:on
727     // End of generated code
728 
729 }
730