Dianne Hackborn | f6729fa | 2020-01-06 13:12:36 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2020 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.content.pm; |
| 18 | |
| 19 | import android.annotation.NonNull; |
| 20 | import android.annotation.Nullable; |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 21 | import android.content.pm.ApplicationInfo; |
Dianne Hackborn | f6729fa | 2020-01-06 13:12:36 -0800 | [diff] [blame] | 22 | import android.os.Parcel; |
| 23 | import android.os.Parcelable; |
| 24 | import android.text.TextUtils; |
| 25 | import android.util.ArraySet; |
| 26 | |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 27 | import com.android.internal.util.DataClass; |
| 28 | import com.android.internal.util.Parcelling; |
| 29 | |
Dianne Hackborn | f6729fa | 2020-01-06 13:12:36 -0800 | [diff] [blame] | 30 | /** |
| 31 | * Information about a process an app may run. This corresponds to information collected from the |
| 32 | * AndroidManifest.xml's <permission-group> tags. |
| 33 | * @hide |
| 34 | */ |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 35 | @DataClass(genGetters = true, genSetters = false, genParcelable = true, genAidl = false, |
| 36 | genBuilder = false) |
Dianne Hackborn | f6729fa | 2020-01-06 13:12:36 -0800 | [diff] [blame] | 37 | public class ProcessInfo implements Parcelable { |
| 38 | /** |
| 39 | * The name of the process, fully-qualified based on the app's package name. |
| 40 | */ |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 41 | @NonNull |
Dianne Hackborn | f6729fa | 2020-01-06 13:12:36 -0800 | [diff] [blame] | 42 | public String name; |
| 43 | |
| 44 | /** |
| 45 | * If non-null, these are permissions that are not allowed in this process. |
| 46 | */ |
| 47 | @Nullable |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 48 | @DataClass.ParcelWith(Parcelling.BuiltIn.ForInternedStringArraySet.class) |
Dianne Hackborn | f6729fa | 2020-01-06 13:12:36 -0800 | [diff] [blame] | 49 | public ArraySet<String> deniedPermissions; |
| 50 | |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 51 | /** |
| 52 | * Indicates if the process has requested GWP-ASan to be enabled, disabled, or left unspecified. |
| 53 | */ |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 54 | public @ApplicationInfo.GwpAsanMode int gwpAsanMode; |
Dianne Hackborn | f6729fa | 2020-01-06 13:12:36 -0800 | [diff] [blame] | 55 | |
| 56 | @Deprecated |
| 57 | public ProcessInfo(@NonNull ProcessInfo orig) { |
| 58 | this.name = orig.name; |
| 59 | this.deniedPermissions = orig.deniedPermissions; |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 60 | this.gwpAsanMode = orig.gwpAsanMode; |
Dianne Hackborn | f6729fa | 2020-01-06 13:12:36 -0800 | [diff] [blame] | 61 | } |
| 62 | |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 63 | |
| 64 | |
| 65 | // Code below generated by codegen v1.0.15. |
| 66 | // |
| 67 | // DO NOT MODIFY! |
| 68 | // CHECKSTYLE:OFF Generated code |
| 69 | // |
| 70 | // To regenerate run: |
| 71 | // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/content/pm/ProcessInfo.java |
| 72 | // |
| 73 | // To exclude the generated code from IntelliJ auto-formatting enable (one-time): |
| 74 | // Settings > Editor > Code Style > Formatter Control |
| 75 | //@formatter:off |
| 76 | |
| 77 | |
| 78 | /** |
| 79 | * Creates a new ProcessInfo. |
| 80 | * |
| 81 | * @param name |
| 82 | * The name of the process, fully-qualified based on the app's package name. |
| 83 | * @param deniedPermissions |
| 84 | * If non-null, these are permissions that are not allowed in this process. |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 85 | * @param gwpAsanMode |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 86 | * Indicates if the process has requested GWP-ASan to be enabled, disabled, or left unspecified. |
| 87 | */ |
| 88 | @DataClass.Generated.Member |
| 89 | public ProcessInfo( |
| 90 | @NonNull String name, |
| 91 | @Nullable ArraySet<String> deniedPermissions, |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 92 | @ApplicationInfo.GwpAsanMode int gwpAsanMode) { |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 93 | this.name = name; |
| 94 | com.android.internal.util.AnnotationValidations.validate( |
| 95 | NonNull.class, null, name); |
| 96 | this.deniedPermissions = deniedPermissions; |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 97 | this.gwpAsanMode = gwpAsanMode; |
| 98 | com.android.internal.util.AnnotationValidations.validate( |
| 99 | ApplicationInfo.GwpAsanMode.class, null, gwpAsanMode); |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 100 | |
| 101 | // onConstructed(); // You can define this method to get a callback |
Dianne Hackborn | f6729fa | 2020-01-06 13:12:36 -0800 | [diff] [blame] | 102 | } |
| 103 | |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 104 | @DataClass.Generated.Member |
| 105 | static Parcelling<ArraySet<String>> sParcellingForDeniedPermissions = |
| 106 | Parcelling.Cache.get( |
| 107 | Parcelling.BuiltIn.ForInternedStringArraySet.class); |
| 108 | static { |
| 109 | if (sParcellingForDeniedPermissions == null) { |
| 110 | sParcellingForDeniedPermissions = Parcelling.Cache.put( |
| 111 | new Parcelling.BuiltIn.ForInternedStringArraySet()); |
Dianne Hackborn | f6729fa | 2020-01-06 13:12:36 -0800 | [diff] [blame] | 112 | } |
| 113 | } |
| 114 | |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 115 | @Override |
| 116 | @DataClass.Generated.Member |
| 117 | public void writeToParcel(@NonNull Parcel dest, int flags) { |
| 118 | // You can override field parcelling by defining methods like: |
| 119 | // void parcelFieldName(Parcel dest, int flags) { ... } |
Dianne Hackborn | f6729fa | 2020-01-06 13:12:36 -0800 | [diff] [blame] | 120 | |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 121 | byte flg = 0; |
| 122 | if (deniedPermissions != null) flg |= 0x2; |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 123 | dest.writeByte(flg); |
| 124 | dest.writeString(name); |
| 125 | sParcellingForDeniedPermissions.parcel(deniedPermissions, dest, flags); |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 126 | dest.writeInt(gwpAsanMode); |
Dianne Hackborn | f6729fa | 2020-01-06 13:12:36 -0800 | [diff] [blame] | 127 | } |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 128 | |
| 129 | @Override |
| 130 | @DataClass.Generated.Member |
| 131 | public int describeContents() { return 0; } |
| 132 | |
| 133 | /** @hide */ |
| 134 | @SuppressWarnings({"unchecked", "RedundantCast"}) |
| 135 | @DataClass.Generated.Member |
| 136 | protected ProcessInfo(@NonNull Parcel in) { |
| 137 | // You can override field unparcelling by defining methods like: |
| 138 | // static FieldType unparcelFieldName(Parcel in) { ... } |
| 139 | |
| 140 | byte flg = in.readByte(); |
| 141 | String _name = in.readString(); |
| 142 | ArraySet<String> _deniedPermissions = sParcellingForDeniedPermissions.unparcel(in); |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 143 | int _gwpAsanMode = in.readInt(); |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 144 | |
| 145 | this.name = _name; |
| 146 | com.android.internal.util.AnnotationValidations.validate( |
| 147 | NonNull.class, null, name); |
| 148 | this.deniedPermissions = _deniedPermissions; |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 149 | this.gwpAsanMode = _gwpAsanMode; |
| 150 | com.android.internal.util.AnnotationValidations.validate( |
| 151 | ApplicationInfo.GwpAsanMode.class, null, gwpAsanMode); |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 152 | |
| 153 | // onConstructed(); // You can define this method to get a callback |
| 154 | } |
| 155 | |
| 156 | @DataClass.Generated.Member |
| 157 | public static final @NonNull Parcelable.Creator<ProcessInfo> CREATOR |
| 158 | = new Parcelable.Creator<ProcessInfo>() { |
| 159 | @Override |
| 160 | public ProcessInfo[] newArray(int size) { |
| 161 | return new ProcessInfo[size]; |
| 162 | } |
| 163 | |
| 164 | @Override |
| 165 | public ProcessInfo createFromParcel(@NonNull Parcel in) { |
| 166 | return new ProcessInfo(in); |
| 167 | } |
| 168 | }; |
| 169 | |
| 170 | @DataClass.Generated( |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 171 | time = 1584555730519L, |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 172 | codegenVersion = "1.0.15", |
| 173 | sourceFile = "frameworks/base/core/java/android/content/pm/ProcessInfo.java", |
Evgenii Stepanov | d43d109 | 2020-03-16 13:55:42 -0700 | [diff] [blame] | 174 | inputSignatures = "public @android.annotation.NonNull java.lang.String name\npublic @android.annotation.Nullable @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForInternedStringArraySet.class) android.util.ArraySet<java.lang.String> deniedPermissions\npublic @android.content.pm.ApplicationInfo.GwpAsanMode int gwpAsanMode\nclass ProcessInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genGetters=true, genSetters=false, genParcelable=true, genAidl=false, genBuilder=false)") |
Evgenii Stepanov | 102d3d8 | 2020-02-12 16:48:14 -0800 | [diff] [blame] | 175 | @Deprecated |
| 176 | private void __metadata() {} |
| 177 | |
| 178 | |
| 179 | //@formatter:on |
| 180 | // End of generated code |
| 181 | |
Dianne Hackborn | f6729fa | 2020-01-06 13:12:36 -0800 | [diff] [blame] | 182 | } |