blob: 0c893b0ff06a22eb5558ef89f54e72efec61f39d [file] [log] [blame]
Kenny Root15a4d2f2010-03-11 18:20:12 -08001/*
2 * Copyright (C) 2007 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
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080017package android.content.pm;
18
Alan Viveretteb6a25732017-11-21 14:49:24 -050019import android.annotation.Nullable;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020import android.os.Parcel;
21import android.os.Parcelable;
22
23/**
24 * Overall information about the contents of a package. This corresponds
25 * to all of the information collected from AndroidManifest.xml.
26 */
27public class PackageInfo implements Parcelable {
28 /**
29 * The name of this package. From the <manifest> tag's "name"
30 * attribute.
31 */
32 public String packageName;
33
34 /**
Jeff Sharkey6c833e02014-07-14 22:44:30 -070035 * The names of any installed split APKs for this package.
36 */
37 public String[] splitNames;
38
39 /**
Dianne Hackborn3accca02013-09-20 09:32:11 -070040 * @deprecated Use {@link #getLongVersionCode()} instead, which includes both
41 * this and the additional
42 * {@link android.R.styleable#AndroidManifest_versionCodeMajor versionCodeMajor} attribute.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080043 * The version number of this package, as specified by the <manifest>
44 * tag's {@link android.R.styleable#AndroidManifest_versionCode versionCode}
45 * attribute.
Dianne Hackborn3accca02013-09-20 09:32:11 -070046 * @see #getLongVersionCode()
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080047 */
Dianne Hackborn3accca02013-09-20 09:32:11 -070048 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049 public int versionCode;
Jeff Sharkey88d2a3c2014-11-22 16:49:34 -080050
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080051 /**
Dianne Hackborn3accca02013-09-20 09:32:11 -070052 * @hide
53 * The major version number of this package, as specified by the <manifest>
54 * tag's {@link android.R.styleable#AndroidManifest_versionCode versionCodeMajor}
55 * attribute.
56 * @see #getLongVersionCode()
57 */
58 public int versionCodeMajor;
59
60 /**
61 * Return {@link android.R.styleable#AndroidManifest_versionCode versionCode} and
62 * {@link android.R.styleable#AndroidManifest_versionCodeMajor versionCodeMajor} combined
63 * together as a single long value. The
64 * {@link android.R.styleable#AndroidManifest_versionCodeMajor versionCodeMajor} is placed in
65 * the upper 32 bits.
66 */
67 public long getLongVersionCode() {
68 return composeLongVersionCode(versionCodeMajor, versionCode);
69 }
70
71 /**
72 * Set the full version code in this PackageInfo, updating {@link #versionCode}
73 * with the lower bits.
74 * @see #getLongVersionCode()
75 */
76 public void setLongVersionCode(long longVersionCode) {
77 versionCodeMajor = (int) (longVersionCode>>32);
78 versionCode = (int) longVersionCode;
79 }
80
81 /**
82 * @hide Internal implementation for composing a minor and major version code in to
83 * a single long version code.
84 */
85 public static long composeLongVersionCode(int major, int minor) {
86 return (((long) major) << 32) | (((long) minor) & 0xffffffffL);
87 }
88
89 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080090 * The version name of this package, as specified by the &lt;manifest&gt;
91 * tag's {@link android.R.styleable#AndroidManifest_versionName versionName}
92 * attribute.
93 */
94 public String versionName;
Jeff Sharkey88d2a3c2014-11-22 16:49:34 -080095
96 /**
97 * The revision number of the base APK for this package, as specified by the
98 * &lt;manifest&gt; tag's
99 * {@link android.R.styleable#AndroidManifest_revisionCode revisionCode}
100 * attribute.
101 */
102 public int baseRevisionCode;
103
104 /**
105 * The revision number of any split APKs for this package, as specified by
106 * the &lt;manifest&gt; tag's
107 * {@link android.R.styleable#AndroidManifest_revisionCode revisionCode}
108 * attribute. Indexes are a 1:1 mapping against {@link #splitNames}.
109 */
110 public int[] splitRevisionCodes;
111
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800112 /**
113 * The shared user ID name of this package, as specified by the &lt;manifest&gt;
114 * tag's {@link android.R.styleable#AndroidManifest_sharedUserId sharedUserId}
115 * attribute.
116 */
117 public String sharedUserId;
118
119 /**
120 * The shared user ID label of this package, as specified by the &lt;manifest&gt;
121 * tag's {@link android.R.styleable#AndroidManifest_sharedUserLabel sharedUserLabel}
122 * attribute.
123 */
124 public int sharedUserLabel;
125
126 /**
127 * Information collected from the &lt;application&gt; tag, or null if
128 * there was none.
129 */
130 public ApplicationInfo applicationInfo;
131
132 /**
Dianne Hackborn78d6883692010-10-07 01:12:46 -0700133 * The time at which the app was first installed. Units are as
134 * per {@link System#currentTimeMillis()}.
135 */
136 public long firstInstallTime;
137
138 /**
139 * The time at which the app was last updated. Units are as
140 * per {@link System#currentTimeMillis()}.
141 */
142 public long lastUpdateTime;
143
144 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800145 * All kernel group-IDs that have been assigned to this package.
146 * This is only filled in if the flag {@link PackageManager#GET_GIDS} was set.
147 */
148 public int[] gids;
149
150 /**
151 * Array of all {@link android.R.styleable#AndroidManifestActivity
152 * &lt;activity&gt;} tags included under &lt;application&gt;,
153 * or null if there were none. This is only filled in if the flag
154 * {@link PackageManager#GET_ACTIVITIES} was set.
155 */
156 public ActivityInfo[] activities;
157
158 /**
159 * Array of all {@link android.R.styleable#AndroidManifestReceiver
160 * &lt;receiver&gt;} tags included under &lt;application&gt;,
161 * or null if there were none. This is only filled in if the flag
162 * {@link PackageManager#GET_RECEIVERS} was set.
163 */
164 public ActivityInfo[] receivers;
165
166 /**
167 * Array of all {@link android.R.styleable#AndroidManifestService
168 * &lt;service&gt;} tags included under &lt;application&gt;,
169 * or null if there were none. This is only filled in if the flag
170 * {@link PackageManager#GET_SERVICES} was set.
171 */
172 public ServiceInfo[] services;
173
174 /**
175 * Array of all {@link android.R.styleable#AndroidManifestProvider
176 * &lt;provider&gt;} tags included under &lt;application&gt;,
177 * or null if there were none. This is only filled in if the flag
178 * {@link PackageManager#GET_PROVIDERS} was set.
179 */
180 public ProviderInfo[] providers;
181
182 /**
183 * Array of all {@link android.R.styleable#AndroidManifestInstrumentation
184 * &lt;instrumentation&gt;} tags included under &lt;manifest&gt;,
185 * or null if there were none. This is only filled in if the flag
186 * {@link PackageManager#GET_INSTRUMENTATION} was set.
187 */
188 public InstrumentationInfo[] instrumentation;
Svet Ganov67882122016-12-11 16:36:34 -0800189
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800190 /**
191 * Array of all {@link android.R.styleable#AndroidManifestPermission
192 * &lt;permission&gt;} tags included under &lt;manifest&gt;,
193 * or null if there were none. This is only filled in if the flag
194 * {@link PackageManager#GET_PERMISSIONS} was set.
195 */
196 public PermissionInfo[] permissions;
Svet Ganov67882122016-12-11 16:36:34 -0800197
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800198 /**
199 * Array of all {@link android.R.styleable#AndroidManifestUsesPermission
200 * &lt;uses-permission&gt;} tags included under &lt;manifest&gt;,
201 * or null if there were none. This is only filled in if the flag
202 * {@link PackageManager#GET_PERMISSIONS} was set. This list includes
203 * all permissions requested, even those that were not granted or known
204 * by the system at install time.
205 */
206 public String[] requestedPermissions;
Svet Ganov67882122016-12-11 16:36:34 -0800207
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800208 /**
Dianne Hackborne639da72012-02-21 15:11:13 -0800209 * Array of flags of all {@link android.R.styleable#AndroidManifestUsesPermission
210 * &lt;uses-permission&gt;} tags included under &lt;manifest&gt;,
211 * or null if there were none. This is only filled in if the flag
212 * {@link PackageManager#GET_PERMISSIONS} was set. Each value matches
213 * the corresponding entry in {@link #requestedPermissions}, and will have
Svetoslavc6d1c342015-02-26 14:44:43 -0800214 * the flag {@link #REQUESTED_PERMISSION_GRANTED} set as appropriate.
Dianne Hackborne639da72012-02-21 15:11:13 -0800215 */
216 public int[] requestedPermissionsFlags;
217
218 /**
219 * Flag for {@link #requestedPermissionsFlags}: the requested permission
220 * is required for the application to run; the user can not optionally
Nick Kralevich32eb5b182013-04-11 10:20:09 -0700221 * disable it. Currently all permissions are required.
Svetoslavc6d1c342015-02-26 14:44:43 -0800222 *
223 * @removed We do not support required permissions.
Dianne Hackborne639da72012-02-21 15:11:13 -0800224 */
225 public static final int REQUESTED_PERMISSION_REQUIRED = 1<<0;
226
227 /**
228 * Flag for {@link #requestedPermissionsFlags}: the requested permission
229 * is currently granted to the application.
230 */
231 public static final int REQUESTED_PERMISSION_GRANTED = 1<<1;
232
233 /**
Svetoslav Ganovcdd685c2017-08-22 14:35:04 -0700234 * Array of all signatures read from the package file. This is only filled
235 * in if the flag {@link PackageManager#GET_SIGNATURES} was set. A package
236 * must be singed with at least one certificate which is at position zero.
237 * The package can be signed with additional certificates which appear as
238 * subsequent entries.
239 *
240 * <strong>Note:</strong> Signature ordering is not guaranteed to be
241 * stable which means that a package signed with certificates A and B is
242 * equivalent to being signed with certificates B and A. This means that
243 * in case multiple signatures are reported you cannot assume the one at
244 * the first position to be the same across updates.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800245 */
246 public Signature[] signatures;
247
248 /**
249 * Application specified preferred configuration
250 * {@link android.R.styleable#AndroidManifestUsesConfiguration
251 * &lt;uses-configuration&gt;} tags included under &lt;manifest&gt;,
252 * or null if there were none. This is only filled in if the flag
Adam Lesinskid3edfde2014-08-08 17:32:44 -0700253 * {@link PackageManager#GET_CONFIGURATIONS} was set.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800254 */
255 public ConfigurationInfo[] configPreferences;
256
Dianne Hackborn49237342009-08-27 20:08:01 -0700257 /**
Jeff Sharkeyda96e132014-07-15 14:54:09 -0700258 * Features that this application has requested.
259 *
260 * @see FeatureInfo#FLAG_REQUIRED
Dianne Hackborn49237342009-08-27 20:08:01 -0700261 */
262 public FeatureInfo[] reqFeatures;
Suchi Amalapurapu117818e2010-02-09 03:45:40 -0800263
264 /**
Adam Lesinskid3edfde2014-08-08 17:32:44 -0700265 * Groups of features that this application has requested.
266 * Each group contains a set of features that are required.
267 * A device must match the features listed in {@link #reqFeatures} and one
268 * or more FeatureGroups in order to have satisfied the feature requirement.
269 *
270 * @see FeatureInfo#FLAG_REQUIRED
271 */
272 public FeatureGroupInfo[] featureGroups;
273
274 /**
Suchi Amalapurapu117818e2010-02-09 03:45:40 -0800275 * Constant corresponding to <code>auto</code> in
276 * the {@link android.R.attr#installLocation} attribute.
277 * @hide
278 */
Suchi Amalapurapu90d8ee62010-03-18 11:38:35 -0700279 public static final int INSTALL_LOCATION_UNSPECIFIED = -1;
Jeff Sharkey6c833e02014-07-14 22:44:30 -0700280
Suchi Amalapurapu90d8ee62010-03-18 11:38:35 -0700281 /**
Jeff Sharkey6c833e02014-07-14 22:44:30 -0700282 * Constant corresponding to <code>auto</code> in the
283 * {@link android.R.attr#installLocation} attribute.
Suchi Amalapurapu90d8ee62010-03-18 11:38:35 -0700284 */
Suchi Amalapurapu117818e2010-02-09 03:45:40 -0800285 public static final int INSTALL_LOCATION_AUTO = 0;
Jeff Sharkey6c833e02014-07-14 22:44:30 -0700286
Suchi Amalapurapu117818e2010-02-09 03:45:40 -0800287 /**
Jeff Sharkey6c833e02014-07-14 22:44:30 -0700288 * Constant corresponding to <code>internalOnly</code> in the
289 * {@link android.R.attr#installLocation} attribute.
Suchi Amalapurapu117818e2010-02-09 03:45:40 -0800290 */
291 public static final int INSTALL_LOCATION_INTERNAL_ONLY = 1;
Jeff Sharkey6c833e02014-07-14 22:44:30 -0700292
Suchi Amalapurapu117818e2010-02-09 03:45:40 -0800293 /**
Jeff Sharkey6c833e02014-07-14 22:44:30 -0700294 * Constant corresponding to <code>preferExternal</code> in the
295 * {@link android.R.attr#installLocation} attribute.
Suchi Amalapurapu117818e2010-02-09 03:45:40 -0800296 */
297 public static final int INSTALL_LOCATION_PREFER_EXTERNAL = 2;
Jeff Sharkey6c833e02014-07-14 22:44:30 -0700298
Suchi Amalapurapu117818e2010-02-09 03:45:40 -0800299 /**
Jeff Sharkey6c833e02014-07-14 22:44:30 -0700300 * The install location requested by the package. From the
Suchi Amalapurapu117818e2010-02-09 03:45:40 -0800301 * {@link android.R.attr#installLocation} attribute, one of
Jeff Sharkey6c833e02014-07-14 22:44:30 -0700302 * {@link #INSTALL_LOCATION_AUTO}, {@link #INSTALL_LOCATION_INTERNAL_ONLY},
Suchi Amalapurapu117818e2010-02-09 03:45:40 -0800303 * {@link #INSTALL_LOCATION_PREFER_EXTERNAL}
Suchi Amalapurapu117818e2010-02-09 03:45:40 -0800304 */
305 public int installLocation = INSTALL_LOCATION_INTERNAL_ONLY;
Amith Yamasanidf2e92a2013-03-01 17:04:38 -0800306
307 /** @hide */
Todd Kennedy7c8addf2017-06-27 14:13:55 -0700308 public boolean isStub;
309
310 /** @hide */
Jeff Hao272bf3a2014-10-08 13:34:43 -0700311 public boolean coreApp;
312
313 /** @hide */
Amith Yamasanidf2e92a2013-03-01 17:04:38 -0800314 public boolean requiredForAllUsers;
315
Amith Yamasani0ac1fc92013-03-27 18:56:08 -0700316 /** @hide */
317 public String restrictedAccountType;
318
Amith Yamasaniccbe3892013-04-12 17:52:42 -0700319 /** @hide */
320 public String requiredAccountType;
321
Mårten Kongstad48d22322014-01-31 14:43:27 +0100322 /**
323 * What package, if any, this package will overlay.
324 *
325 * Package name of target package, or null.
326 * @hide
327 */
328 public String overlayTarget;
329
Jaekyun Seok04342892017-03-02 15:24:19 +0900330 /** @hide */
Jaekyun Seok42d53f62017-04-10 13:48:58 +0900331 public int overlayPriority;
332
333 /** @hide */
Jaekyun Seok04342892017-03-02 15:24:19 +0900334 public boolean isStaticOverlay;
335
Alan Viveretteb6a25732017-11-21 14:49:24 -0500336 /**
337 * The user-visible SDK version (ex. 26) of the framework against which the application claims
338 * to have been compiled, or {@code 0} if not specified.
339 * <p>
340 * This property is the compile-time equivalent of
341 * {@link android.os.Build.VERSION#SDK_INT Build.VERSION.SDK_INT}.
342 *
343 * @hide For platform use only; we don't expect developers to need to read this value.
344 */
345 public int compileSdkVersion;
346
347 /**
348 * The development codename (ex. "O", "REL") of the framework against which the application
349 * claims to have been compiled, or {@code null} if not specified.
350 * <p>
351 * This property is the compile-time equivalent of
352 * {@link android.os.Build.VERSION#CODENAME Build.VERSION.CODENAME}.
353 *
354 * @hide For platform use only; we don't expect developers to need to read this value.
355 */
356 @Nullable
357 public String compileSdkVersionCodename;
358
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800359 public PackageInfo() {
360 }
361
Jeff Sharkey88d2a3c2014-11-22 16:49:34 -0800362 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800363 public String toString() {
364 return "PackageInfo{"
365 + Integer.toHexString(System.identityHashCode(this))
366 + " " + packageName + "}";
367 }
368
Jeff Sharkey88d2a3c2014-11-22 16:49:34 -0800369 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800370 public int describeContents() {
371 return 0;
372 }
373
Jeff Sharkey88d2a3c2014-11-22 16:49:34 -0800374 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800375 public void writeToParcel(Parcel dest, int parcelableFlags) {
376 dest.writeString(packageName);
Jeff Sharkey6c833e02014-07-14 22:44:30 -0700377 dest.writeStringArray(splitNames);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800378 dest.writeInt(versionCode);
Dianne Hackborn3accca02013-09-20 09:32:11 -0700379 dest.writeInt(versionCodeMajor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800380 dest.writeString(versionName);
Jeff Sharkey88d2a3c2014-11-22 16:49:34 -0800381 dest.writeInt(baseRevisionCode);
382 dest.writeIntArray(splitRevisionCodes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800383 dest.writeString(sharedUserId);
384 dest.writeInt(sharedUserLabel);
385 if (applicationInfo != null) {
386 dest.writeInt(1);
387 applicationInfo.writeToParcel(dest, parcelableFlags);
388 } else {
389 dest.writeInt(0);
390 }
Dianne Hackborn78d6883692010-10-07 01:12:46 -0700391 dest.writeLong(firstInstallTime);
392 dest.writeLong(lastUpdateTime);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800393 dest.writeIntArray(gids);
Christopher Tateb9116762015-09-09 18:46:31 -0700394 dest.writeTypedArray(activities, parcelableFlags | Parcelable.PARCELABLE_ELIDE_DUPLICATES);
395 dest.writeTypedArray(receivers, parcelableFlags | Parcelable.PARCELABLE_ELIDE_DUPLICATES);
396 dest.writeTypedArray(services, parcelableFlags | Parcelable.PARCELABLE_ELIDE_DUPLICATES);
397 dest.writeTypedArray(providers, parcelableFlags | Parcelable.PARCELABLE_ELIDE_DUPLICATES);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800398 dest.writeTypedArray(instrumentation, parcelableFlags);
399 dest.writeTypedArray(permissions, parcelableFlags);
400 dest.writeStringArray(requestedPermissions);
Dianne Hackborne639da72012-02-21 15:11:13 -0800401 dest.writeIntArray(requestedPermissionsFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800402 dest.writeTypedArray(signatures, parcelableFlags);
403 dest.writeTypedArray(configPreferences, parcelableFlags);
Dianne Hackborn49237342009-08-27 20:08:01 -0700404 dest.writeTypedArray(reqFeatures, parcelableFlags);
Adam Lesinskid3edfde2014-08-08 17:32:44 -0700405 dest.writeTypedArray(featureGroups, parcelableFlags);
Suchi Amalapurapu117818e2010-02-09 03:45:40 -0800406 dest.writeInt(installLocation);
Todd Kennedy7c8addf2017-06-27 14:13:55 -0700407 dest.writeInt(isStub ? 1 : 0);
Jeff Hao272bf3a2014-10-08 13:34:43 -0700408 dest.writeInt(coreApp ? 1 : 0);
Amith Yamasanidf2e92a2013-03-01 17:04:38 -0800409 dest.writeInt(requiredForAllUsers ? 1 : 0);
Amith Yamasani0ac1fc92013-03-27 18:56:08 -0700410 dest.writeString(restrictedAccountType);
Amith Yamasaniccbe3892013-04-12 17:52:42 -0700411 dest.writeString(requiredAccountType);
Mårten Kongstad48d22322014-01-31 14:43:27 +0100412 dest.writeString(overlayTarget);
Jaekyun Seok04342892017-03-02 15:24:19 +0900413 dest.writeInt(isStaticOverlay ? 1 : 0);
Jaekyun Seok42d53f62017-04-10 13:48:58 +0900414 dest.writeInt(overlayPriority);
Alan Viveretteb6a25732017-11-21 14:49:24 -0500415 dest.writeInt(compileSdkVersion);
416 dest.writeString(compileSdkVersionCodename);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800417 }
418
419 public static final Parcelable.Creator<PackageInfo> CREATOR
420 = new Parcelable.Creator<PackageInfo>() {
Jeff Sharkey88d2a3c2014-11-22 16:49:34 -0800421 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800422 public PackageInfo createFromParcel(Parcel source) {
423 return new PackageInfo(source);
424 }
425
Jeff Sharkey88d2a3c2014-11-22 16:49:34 -0800426 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800427 public PackageInfo[] newArray(int size) {
428 return new PackageInfo[size];
429 }
430 };
431
432 private PackageInfo(Parcel source) {
433 packageName = source.readString();
Jeff Sharkey88d2a3c2014-11-22 16:49:34 -0800434 splitNames = source.createStringArray();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800435 versionCode = source.readInt();
Dianne Hackborn3accca02013-09-20 09:32:11 -0700436 versionCodeMajor = source.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800437 versionName = source.readString();
Jeff Sharkey88d2a3c2014-11-22 16:49:34 -0800438 baseRevisionCode = source.readInt();
439 splitRevisionCodes = source.createIntArray();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800440 sharedUserId = source.readString();
441 sharedUserLabel = source.readInt();
442 int hasApp = source.readInt();
443 if (hasApp != 0) {
444 applicationInfo = ApplicationInfo.CREATOR.createFromParcel(source);
445 }
Dianne Hackborn78d6883692010-10-07 01:12:46 -0700446 firstInstallTime = source.readLong();
447 lastUpdateTime = source.readLong();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800448 gids = source.createIntArray();
449 activities = source.createTypedArray(ActivityInfo.CREATOR);
450 receivers = source.createTypedArray(ActivityInfo.CREATOR);
451 services = source.createTypedArray(ServiceInfo.CREATOR);
452 providers = source.createTypedArray(ProviderInfo.CREATOR);
453 instrumentation = source.createTypedArray(InstrumentationInfo.CREATOR);
454 permissions = source.createTypedArray(PermissionInfo.CREATOR);
455 requestedPermissions = source.createStringArray();
Dianne Hackborne639da72012-02-21 15:11:13 -0800456 requestedPermissionsFlags = source.createIntArray();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800457 signatures = source.createTypedArray(Signature.CREATOR);
458 configPreferences = source.createTypedArray(ConfigurationInfo.CREATOR);
Dianne Hackborn49237342009-08-27 20:08:01 -0700459 reqFeatures = source.createTypedArray(FeatureInfo.CREATOR);
Adam Lesinskid3edfde2014-08-08 17:32:44 -0700460 featureGroups = source.createTypedArray(FeatureGroupInfo.CREATOR);
Suchi Amalapurapu117818e2010-02-09 03:45:40 -0800461 installLocation = source.readInt();
Todd Kennedy7c8addf2017-06-27 14:13:55 -0700462 isStub = source.readInt() != 0;
Jeff Hao272bf3a2014-10-08 13:34:43 -0700463 coreApp = source.readInt() != 0;
Amith Yamasanidf2e92a2013-03-01 17:04:38 -0800464 requiredForAllUsers = source.readInt() != 0;
Amith Yamasani0ac1fc92013-03-27 18:56:08 -0700465 restrictedAccountType = source.readString();
Amith Yamasaniccbe3892013-04-12 17:52:42 -0700466 requiredAccountType = source.readString();
Mårten Kongstad48d22322014-01-31 14:43:27 +0100467 overlayTarget = source.readString();
Jaekyun Seok04342892017-03-02 15:24:19 +0900468 isStaticOverlay = source.readInt() != 0;
Jaekyun Seok42d53f62017-04-10 13:48:58 +0900469 overlayPriority = source.readInt();
Alan Viveretteb6a25732017-11-21 14:49:24 -0500470 compileSdkVersion = source.readInt();
471 compileSdkVersionCodename = source.readString();
Christopher Tateb9116762015-09-09 18:46:31 -0700472
473 // The component lists were flattened with the redundant ApplicationInfo
474 // instances omitted. Distribute the canonical one here as appropriate.
475 if (applicationInfo != null) {
476 propagateApplicationInfo(applicationInfo, activities);
477 propagateApplicationInfo(applicationInfo, receivers);
478 propagateApplicationInfo(applicationInfo, services);
479 propagateApplicationInfo(applicationInfo, providers);
480 }
481 }
482
483 private void propagateApplicationInfo(ApplicationInfo appInfo, ComponentInfo[] components) {
484 if (components != null) {
485 for (ComponentInfo ci : components) {
486 ci.applicationInfo = appInfo;
487 }
488 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800489 }
490}