ApplicationInfo.java revision 8924e8759f9a8cffb5ad538ca40a7826793aac07
115a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root/*
215a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * Copyright (C) 2007 The Android Open Source Project
315a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root *
415a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * Licensed under the Apache License, Version 2.0 (the "License");
515a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * you may not use this file except in compliance with the License.
615a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * You may obtain a copy of the License at
715a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root *
815a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root *      http://www.apache.org/licenses/LICENSE-2.0
915a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root *
1015a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * Unless required by applicable law or agreed to in writing, software
1115a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * distributed under the License is distributed on an "AS IS" BASIS,
1215a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1315a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * See the License for the specific language governing permissions and
1415a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * limitations under the License.
1515a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root */
1615a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root
179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpackage android.content.pm;
189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1907330791116513710d879c45b2f095cd314cbfd0Jeff Brownimport android.content.pm.PackageManager.NameNotFoundException;
2007330791116513710d879c45b2f095cd314cbfd0Jeff Brownimport android.content.res.Resources;
2107330791116513710d879c45b2f095cd314cbfd0Jeff Brownimport android.graphics.drawable.Drawable;
2215447798a38d2b5acb1998731340255f4203f294Jeff Sharkeyimport android.os.Environment;
239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.os.Parcel;
249066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.os.Parcelable;
25f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkeyimport android.os.SystemProperties;
2615447798a38d2b5acb1998731340255f4203f294Jeff Sharkeyimport android.os.UserHandle;
27f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkeyimport android.os.storage.StorageManager;
28e2d45be4dae116307f8edd85eaa61134221cb8f9Jeff Sharkeyimport android.text.TextUtils;
299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.util.Printer;
309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
318a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkeyimport com.android.internal.util.ArrayUtils;
328a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey
339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport java.text.Collator;
348a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkeyimport java.util.Arrays;
359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport java.util.Comparator;
368a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkeyimport java.util.Objects;
379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/**
399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Information you can retrieve about a particular application.  This
409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * corresponds to information collected from the AndroidManifest.xml's
419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * <application> tag.
429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */
439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpublic class ApplicationInfo extends PackageItemInfo implements Parcelable {
449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Default task affinity of all activities in this application. See
479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * {@link ActivityInfo#taskAffinity} for more information.  This comes
489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * from the "taskAffinity" attribute.
499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String taskAffinity;
519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Optional name of a permission required to be able to access this
549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * application's components.  From the "permission" attribute.
559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String permission;
579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * The name of the process this application should run in.  From the
609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * "process" attribute or, if not set, the same as
619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * <var>packageName</var>.
629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String processName;
649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Class implementing the Application object.  From the "class"
679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * attribute.
689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String className;
709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * A style resource identifier (in the package's resources) of the
739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * description of an application.  From the "description" attribute
749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * or, if not set, 0.
759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public int descriptionRes;
779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * A style resource identifier (in the package's resources) of the
809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * default visual theme of the application.  From the "theme" attribute
819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * or, if not set, 0.
829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public int theme;
849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
869066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Class implementing the Application's manage space
879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * functionality.  From the "manageSpaceActivity"
889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * attribute. This is an optional attribute and will be null if
89181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * applications don't specify it in their manifest
909066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
919066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String manageSpaceActivityName;
929066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
939066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
94181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * Class implementing the Application's backup functionality.  From
95181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * the "backupAgent" attribute.  This is an optional attribute and
96181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * will be null if the application does not specify it in its manifest.
97181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     *
98181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * <p>If android:allowBackup is set to false, this attribute is ignored.
99181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     */
100181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate    public String backupAgentName;
1014a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate
1024a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate    /**
103303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams     * An optional attribute that indicates the app supports automatic backup of app data.
104303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams     * <p>0 is the default and means the app's entire data folder + managed external storage will
105303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams     * be backed up;
106303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams     * Any negative value indicates the app does not support full-data backup, though it may still
107303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams     * want to participate via the traditional key/value backup API;
108303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams     * A positive number specifies an xml resource in which the application has defined its backup
109303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams     * include/exclude criteria.
110303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams     * <p>If android:allowBackup is set to false, this attribute is ignored.
111303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams     *
112303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams     * @see {@link android.content.Context#getNoBackupFilesDir}
113303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams     * @see {@link #FLAG_ALLOW_BACKUP}
11498fa656f1636525c27a6d91ad4d7a3385292b99aChristopher Tate     *
11598fa656f1636525c27a6d91ad4d7a3385292b99aChristopher Tate     * @hide
116303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams     */
117303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams    public int fullBackupContent = 0;
118303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams
119303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams    /**
120269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell     * The default extra UI options for activities in this application.
121269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell     * Set from the {@link android.R.attr#uiOptions} attribute in the
122269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell     * activity's manifest.
123269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell     */
124269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell    public int uiOptions = 0;
125269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell
126269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell    /**
1279066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Value for {@link #flags}: if set, this application is installed in the
1289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * device's system image.
1299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_SYSTEM = 1<<0;
1319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
1339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Value for {@link #flags}: set to true if this application would like to
1349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * allow debugging of its
1359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * code, even when installed on a non-development system.  Comes
1369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * from {@link android.R.styleable#AndroidManifestApplication_debuggable
1379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * android:debuggable} of the &lt;application&gt; tag.
1389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_DEBUGGABLE = 1<<1;
1409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
1429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Value for {@link #flags}: set to true if this application has code
1439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * associated with it.  Comes
1449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * from {@link android.R.styleable#AndroidManifestApplication_hasCode
1459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * android:hasCode} of the &lt;application&gt; tag.
1469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_HAS_CODE = 1<<2;
1489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
1509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Value for {@link #flags}: set to true if this application is persistent.
1519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Comes from {@link android.R.styleable#AndroidManifestApplication_persistent
1529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * android:persistent} of the &lt;application&gt; tag.
1539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_PERSISTENT = 1<<3;
1559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
157181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * Value for {@link #flags}: set to true if this application holds the
1589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * {@link android.Manifest.permission#FACTORY_TEST} permission and the
1599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * device is running in factory test mode.
1609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_FACTORY_TEST = 1<<4;
1629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
1649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Value for {@link #flags}: default value for the corresponding ActivityInfo flag.
1659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Comes from {@link android.R.styleable#AndroidManifestApplication_allowTaskReparenting
1669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * android:allowTaskReparenting} of the &lt;application&gt; tag.
1679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_ALLOW_TASK_REPARENTING = 1<<5;
1699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
1719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Value for {@link #flags}: default value for the corresponding ActivityInfo flag.
1729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Comes from {@link android.R.styleable#AndroidManifestApplication_allowClearUserData
1739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * android:allowClearUserData} of the &lt;application&gt; tag.
1749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_ALLOW_CLEAR_USER_DATA = 1<<6;
1769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
178851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn     * Value for {@link #flags}: this is set if this application has been
179851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn     * install as an update to a built-in system application.
1809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_UPDATED_SYSTEM_APP = 1<<7;
182851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn
183851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn    /**
1847f2054392e9957d3ba8579ef08c29cfb27df564eDianne Hackborn     * Value for {@link #flags}: this is set of the application has specified
1857f2054392e9957d3ba8579ef08c29cfb27df564eDianne Hackborn     * {@link android.R.styleable#AndroidManifestApplication_testOnly
1867f2054392e9957d3ba8579ef08c29cfb27df564eDianne Hackborn     * android:testOnly} to be true.
187851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn     */
188a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn    public static final int FLAG_TEST_ONLY = 1<<8;
189ade3ecad94d1f4431576f53bae26c35efbf7a2c9Dianne Hackborn
190ade3ecad94d1f4431576f53bae26c35efbf7a2c9Dianne Hackborn    /**
1915c1e00b14d2ef10ec76abf3e951fa8003a67f558Dianne Hackborn     * Value for {@link #flags}: true when the application's window can be
192723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * reduced in size for smaller screens.  Corresponds to
193723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_smallScreens
194723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * android:smallScreens}.
1955c1e00b14d2ef10ec76abf3e951fa8003a67f558Dianne Hackborn     */
196723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn    public static final int FLAG_SUPPORTS_SMALL_SCREENS = 1<<9;
197723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn
198723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn    /**
199723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * Value for {@link #flags}: true when the application's window can be
200723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * displayed on normal screens.  Corresponds to
201723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_normalScreens
202723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * android:normalScreens}.
203723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     */
204723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn    public static final int FLAG_SUPPORTS_NORMAL_SCREENS = 1<<10;
205723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn
206723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn    /**
207723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * Value for {@link #flags}: true when the application's window can be
208723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * increased in size for larger screens.  Corresponds to
209723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_largeScreens
21022ec9ab3b881d71866279ba9363c644a9e4e7164Dianne Hackborn     * android:largeScreens}.
211723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     */
212723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn    public static final int FLAG_SUPPORTS_LARGE_SCREENS = 1<<11;
2135c1e00b14d2ef10ec76abf3e951fa8003a67f558Dianne Hackborn
2145c1e00b14d2ef10ec76abf3e951fa8003a67f558Dianne Hackborn    /**
215c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn     * Value for {@link #flags}: true when the application knows how to adjust
216c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn     * its UI for different screen sizes.  Corresponds to
217c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_resizeable
218c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn     * android:resizeable}.
219c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn     */
220c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn    public static final int FLAG_RESIZEABLE_FOR_SCREENS = 1<<12;
221c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn
222c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn    /**
22311b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn     * Value for {@link #flags}: true when the application knows how to
22411b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn     * accomodate different screen densities.  Corresponds to
22511b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_anyDensity
22611b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn     * android:anyDensity}.
22711b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn     */
22811b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn    public static final int FLAG_SUPPORTS_SCREEN_DENSITIES = 1<<13;
22911b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn
23011b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn    /**
23123085b781e145ed684e7270af1d5ced6800b8effBen Cheng     * Value for {@link #flags}: set to true if this application would like to
23223085b781e145ed684e7270af1d5ced6800b8effBen Cheng     * request the VM to operate under the safe mode. Comes from
233ef3f5ddc2137ed99e41f00441b688fb56b855179Ben Cheng     * {@link android.R.styleable#AndroidManifestApplication_vmSafeMode
234ef3f5ddc2137ed99e41f00441b688fb56b855179Ben Cheng     * android:vmSafeMode} of the &lt;application&gt; tag.
23523085b781e145ed684e7270af1d5ced6800b8effBen Cheng     */
23623085b781e145ed684e7270af1d5ced6800b8effBen Cheng    public static final int FLAG_VM_SAFE_MODE = 1<<14;
23723085b781e145ed684e7270af1d5ced6800b8effBen Cheng
23823085b781e145ed684e7270af1d5ced6800b8effBen Cheng    /**
2393de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * Value for {@link #flags}: set to <code>false</code> if the application does not wish
2403de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * to permit any OS-driven backups of its data; <code>true</code> otherwise.
241181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     *
2423de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * <p>Comes from the
2433de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup}
2443de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * attribute of the &lt;application&gt; tag.
245181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     */
24623085b781e145ed684e7270af1d5ced6800b8effBen Cheng    public static final int FLAG_ALLOW_BACKUP = 1<<15;
2475e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate
2485e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate    /**
2493de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * Value for {@link #flags}: set to <code>false</code> if the application must be kept
2503de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * in memory following a full-system restore operation; <code>true</code> otherwise.
2513de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * Ordinarily, during a full system restore operation each application is shut down
2523de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * following execution of its agent's onRestore() method.  Setting this attribute to
2533de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * <code>false</code> prevents this.  Most applications will not need to set this attribute.
2545e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     *
2553de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * <p>If
2563de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup}
2573de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * is set to <code>false</code> or no
2583de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * {@link android.R.styleable#AndroidManifestApplication_backupAgent android:backupAgent}
2595e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     * is specified, this flag will be ignored.
2605e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     *
2613de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * <p>Comes from the
2623de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * {@link android.R.styleable#AndroidManifestApplication_killAfterRestore android:killAfterRestore}
2633de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * attribute of the &lt;application&gt; tag.
2645e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     */
26523085b781e145ed684e7270af1d5ced6800b8effBen Cheng    public static final int FLAG_KILL_AFTER_RESTORE = 1<<16;
2665e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate
2675e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate    /**
2683de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * Value for {@link #flags}: Set to <code>true</code> if the application's backup
2693de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * agent claims to be able to handle restore data even "from the future,"
2703de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * i.e. from versions of the application with a versionCode greater than
2713de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * the one currently installed on the device.  <i>Use with caution!</i>  By default
2723de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * this attribute is <code>false</code> and the Backup Manager will ensure that data
2733de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * from "future" versions of the application are never supplied during a restore operation.
2745e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     *
2753de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * <p>If
2763de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup}
2773de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * is set to <code>false</code> or no
2783de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * {@link android.R.styleable#AndroidManifestApplication_backupAgent android:backupAgent}
2795e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     * is specified, this flag will be ignored.
2805e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     *
2813de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * <p>Comes from the
2823de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * {@link android.R.styleable#AndroidManifestApplication_restoreAnyVersion android:restoreAnyVersion}
2833de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * attribute of the &lt;application&gt; tag.
2845e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     */
2853de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate    public static final int FLAG_RESTORE_ANY_VERSION = 1<<17;
2865e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate
287181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate    /**
2883202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn     * Value for {@link #flags}: Set to true if the application is
2893202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn     * currently installed on external/removable/unprotected storage.  Such
2903202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn     * applications may not be available if their storage is not currently
2913202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn     * mounted.  When the storage it is on is not available, it will look like
2923202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn     * the application has been uninstalled (its .apk is no longer available)
2933202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn     * but its persistent data is not removed.
294af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu     */
29594c567e1e344d49168603f5a0560215a4ce735e6Dianne Hackborn    public static final int FLAG_EXTERNAL_STORAGE = 1<<18;
296af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu
297af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu    /**
29814cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn     * Value for {@link #flags}: true when the application's window can be
29914cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn     * increased in size for extra large screens.  Corresponds to
30014cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_xlargeScreens
30122ec9ab3b881d71866279ba9363c644a9e4e7164Dianne Hackborn     * android:xlargeScreens}.
30214cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn     */
30314cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn    public static final int FLAG_SUPPORTS_XLARGE_SCREENS = 1<<19;
30414cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn
30514cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn    /**
3063b81bc18bb661c02ad8074c39dab16644c1e65d0Dianne Hackborn     * Value for {@link #flags}: true when the application has requested a
3073b81bc18bb661c02ad8074c39dab16644c1e65d0Dianne Hackborn     * large heap for its processes.  Corresponds to
3083b81bc18bb661c02ad8074c39dab16644c1e65d0Dianne Hackborn     * {@link android.R.styleable#AndroidManifestApplication_largeHeap
3093b81bc18bb661c02ad8074c39dab16644c1e65d0Dianne Hackborn     * android:largeHeap}.
310a3cdaa5337fa573c4c61770195d6232c2e587090Jason parks     */
3113b81bc18bb661c02ad8074c39dab16644c1e65d0Dianne Hackborn    public static final int FLAG_LARGE_HEAP = 1<<20;
312a3cdaa5337fa573c4c61770195d6232c2e587090Jason parks
313a3cdaa5337fa573c4c61770195d6232c2e587090Jason parks    /**
314e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn     * Value for {@link #flags}: true if this application's package is in
315e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn     * the stopped state.
316e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn     */
317e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn    public static final int FLAG_STOPPED = 1<<21;
318e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn
319e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn    /**
32059dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     * Value for {@link #flags}: true  when the application is willing to support
32159dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     * RTL (right to left). All activities will inherit this value.
32259dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     *
32359dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     * Set from the {@link android.R.attr#supportsRtl} attribute in the
32459dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     * activity's manifest.
32559dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     *
32659dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     * Default value is false (no support for RTL).
32759dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     */
32859dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio    public static final int FLAG_SUPPORTS_RTL = 1<<22;
32959dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio
33059dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio    /**
3317767eac3232ba2fb9828766813cdb481d6a97584Dianne Hackborn     * Value for {@link #flags}: true if the application is currently
3327767eac3232ba2fb9828766813cdb481d6a97584Dianne Hackborn     * installed for the calling user.
3337767eac3232ba2fb9828766813cdb481d6a97584Dianne Hackborn     */
3347767eac3232ba2fb9828766813cdb481d6a97584Dianne Hackborn    public static final int FLAG_INSTALLED = 1<<23;
3357767eac3232ba2fb9828766813cdb481d6a97584Dianne Hackborn
3367767eac3232ba2fb9828766813cdb481d6a97584Dianne Hackborn    /**
3375e03e2ca7d25b899b129baad2dd5eca6bf99d88aDianne Hackborn     * Value for {@link #flags}: true if the application only has its
3385e03e2ca7d25b899b129baad2dd5eca6bf99d88aDianne Hackborn     * data installed; the application package itself does not currently
3395e03e2ca7d25b899b129baad2dd5eca6bf99d88aDianne Hackborn     * exist on the device.
3405e03e2ca7d25b899b129baad2dd5eca6bf99d88aDianne Hackborn     */
3415e03e2ca7d25b899b129baad2dd5eca6bf99d88aDianne Hackborn    public static final int FLAG_IS_DATA_ONLY = 1<<24;
3425e03e2ca7d25b899b129baad2dd5eca6bf99d88aDianne Hackborn
3435e03e2ca7d25b899b129baad2dd5eca6bf99d88aDianne Hackborn    /**
34412d0b4cd960e18493b1dc237adbfabed432c9df5Jose Lima     * Value for {@link #flags}: true if the application was declared to be a game, or
34512d0b4cd960e18493b1dc237adbfabed432c9df5Jose Lima     * false if it is a non-game application.
34612d0b4cd960e18493b1dc237adbfabed432c9df5Jose Lima     */
34712d0b4cd960e18493b1dc237adbfabed432c9df5Jose Lima    public static final int FLAG_IS_GAME = 1<<25;
34812d0b4cd960e18493b1dc237adbfabed432c9df5Jose Lima
34912d0b4cd960e18493b1dc237adbfabed432c9df5Jose Lima    /**
350d1de2567c6758e81a87c0f5eff9ff53ffebab134Christopher Tate     * Value for {@link #flags}: {@code true} if the application asks that only
351d1de2567c6758e81a87c0f5eff9ff53ffebab134Christopher Tate     * full-data streaming backups of its data be performed even though it defines
352d1de2567c6758e81a87c0f5eff9ff53ffebab134Christopher Tate     * a {@link android.app.backup.BackupAgent BackupAgent}, which normally
353d1de2567c6758e81a87c0f5eff9ff53ffebab134Christopher Tate     * indicates that the app will manage its backed-up data via incremental
354d1de2567c6758e81a87c0f5eff9ff53ffebab134Christopher Tate     * key/value updates.
355d1de2567c6758e81a87c0f5eff9ff53ffebab134Christopher Tate     */
356d1de2567c6758e81a87c0f5eff9ff53ffebab134Christopher Tate    public static final int FLAG_FULL_BACKUP_ONLY = 1<<26;
357d1de2567c6758e81a87c0f5eff9ff53ffebab134Christopher Tate
358d1de2567c6758e81a87c0f5eff9ff53ffebab134Christopher Tate    /**
35901a959d60a2c5f04ab240513a853d7845b3a309eAlex Klyubin     * Value for {@link #flags}: {@code true} if the application may use cleartext network traffic
36001a959d60a2c5f04ab240513a853d7845b3a309eAlex Klyubin     * (e.g., HTTP rather than HTTPS; WebSockets rather than WebSockets Secure; XMPP, IMAP, STMP
36101a959d60a2c5f04ab240513a853d7845b3a309eAlex Klyubin     * without STARTTLS or TLS). If {@code false}, the app declares that it does not intend to use
36201a959d60a2c5f04ab240513a853d7845b3a309eAlex Klyubin     * cleartext network traffic, in which case platform components (e.g., HTTP stacks,
363fbf4599a8edfc31585f207c434d35200a03657b4Alex Klyubin     * {@code DownloadManager}, {@code MediaPlayer}) will refuse app's requests to use cleartext
364fbf4599a8edfc31585f207c434d35200a03657b4Alex Klyubin     * traffic. Third-party libraries are encouraged to honor this flag as well.
365fbf4599a8edfc31585f207c434d35200a03657b4Alex Klyubin     *
366fbf4599a8edfc31585f207c434d35200a03657b4Alex Klyubin     * <p>NOTE: {@code WebView} does not honor this flag.
367fbf4599a8edfc31585f207c434d35200a03657b4Alex Klyubin     *
368fbf4599a8edfc31585f207c434d35200a03657b4Alex Klyubin     * <p>This flag comes from
369fbf4599a8edfc31585f207c434d35200a03657b4Alex Klyubin     * {@link android.R.styleable#AndroidManifestApplication_usesCleartextTraffic
370fbf4599a8edfc31585f207c434d35200a03657b4Alex Klyubin     * android:usesCleartextTraffic} of the &lt;application&gt; tag.
37101a959d60a2c5f04ab240513a853d7845b3a309eAlex Klyubin     */
37201a959d60a2c5f04ab240513a853d7845b3a309eAlex Klyubin    public static final int FLAG_USES_CLEARTEXT_TRAFFIC = 1<<27;
37301a959d60a2c5f04ab240513a853d7845b3a309eAlex Klyubin
37401a959d60a2c5f04ab240513a853d7845b3a309eAlex Klyubin    /**
375ff193d642eea7128faad837d19e347cd25212c27Dmitriy Ivanov     * When set installer extracts native libs from .apk files.
376ff193d642eea7128faad837d19e347cd25212c27Dmitriy Ivanov     */
377ff193d642eea7128faad837d19e347cd25212c27Dmitriy Ivanov    public static final int FLAG_EXTRACT_NATIVE_LIBS = 1<<28;
378ff193d642eea7128faad837d19e347cd25212c27Dmitriy Ivanov
379ff193d642eea7128faad837d19e347cd25212c27Dmitriy Ivanov    /**
380d70b9e7aea9c7b0691f3ac1326752f91d5049458Alan Viverette     * Value for {@link #flags}: {@code true} when the application's rendering
381d70b9e7aea9c7b0691f3ac1326752f91d5049458Alan Viverette     * should be hardware accelerated.
382d70b9e7aea9c7b0691f3ac1326752f91d5049458Alan Viverette     */
383d70b9e7aea9c7b0691f3ac1326752f91d5049458Alan Viverette    public static final int FLAG_HARDWARE_ACCELERATED = 1<<29;
384d70b9e7aea9c7b0691f3ac1326752f91d5049458Alan Viverette
385d70b9e7aea9c7b0691f3ac1326752f91d5049458Alan Viverette    /**
386b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * Value for {@link #flags}: true if code from this application will need to be
387b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * loaded into other applications' processes. On devices that support multiple
388b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * instruction sets, this implies the code might be loaded into a process that's
389b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * using any of the devices supported instruction sets.
390b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     *
391b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * <p> The system might treat such applications specially, for eg., by
392b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * extracting the application's native libraries for all supported instruction
393b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * sets or by compiling the application's dex code for all supported instruction
394b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * sets.
395b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     */
396b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin    public static final int FLAG_MULTIARCH  = 1 << 31;
397b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin
398b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin    /**
399b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * Flags associated with the application.  Any combination of
400b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE},
401b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * {@link #FLAG_PERSISTENT}, {@link #FLAG_FACTORY_TEST}, and
402b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * {@link #FLAG_ALLOW_TASK_REPARENTING}
403b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * {@link #FLAG_ALLOW_CLEAR_USER_DATA}, {@link #FLAG_UPDATED_SYSTEM_APP},
404b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * {@link #FLAG_TEST_ONLY}, {@link #FLAG_SUPPORTS_SMALL_SCREENS},
405b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * {@link #FLAG_SUPPORTS_NORMAL_SCREENS},
406b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * {@link #FLAG_SUPPORTS_LARGE_SCREENS}, {@link #FLAG_SUPPORTS_XLARGE_SCREENS},
407b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * {@link #FLAG_RESIZEABLE_FOR_SCREENS},
408b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * {@link #FLAG_SUPPORTS_SCREEN_DENSITIES}, {@link #FLAG_VM_SAFE_MODE},
409b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * {@link #FLAG_ALLOW_BACKUP}, {@link #FLAG_KILL_AFTER_RESTORE},
410b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * {@link #FLAG_RESTORE_ANY_VERSION}, {@link #FLAG_EXTERNAL_STORAGE},
411b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * {@link #FLAG_LARGE_HEAP}, {@link #FLAG_STOPPED},
412b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * {@link #FLAG_SUPPORTS_RTL}, {@link #FLAG_INSTALLED},
413b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * {@link #FLAG_IS_DATA_ONLY}, {@link #FLAG_IS_GAME},
4147cb000ff56babf18d39ab0aa31dfc5dcac0bf11eAlex Klyubin     * {@link #FLAG_FULL_BACKUP_ONLY}, {@link #FLAG_USES_CLEARTEXT_TRAFFIC},
4157cb000ff56babf18d39ab0aa31dfc5dcac0bf11eAlex Klyubin     * {@link #FLAG_MULTIARCH}.
416b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     */
417b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin    public int flags = 0;
418b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin
419b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin    /**
420b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * Value for {@link #privateFlags}: true if the application is hidden via restrictions and for
421589a1bc0b00e570db079b4b157f60229ad8ef8f9Narayan Kamath     * most purposes is considered as not installed.
422589a1bc0b00e570db079b4b157f60229ad8ef8f9Narayan Kamath     * {@hide}
423589a1bc0b00e570db079b4b157f60229ad8ef8f9Narayan Kamath     */
424b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin    public static final int PRIVATE_FLAG_HIDDEN = 1<<0;
425589a1bc0b00e570db079b4b157f60229ad8ef8f9Narayan Kamath
426589a1bc0b00e570db079b4b157f60229ad8ef8f9Narayan Kamath    /**
427b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * Value for {@link #privateFlags}: set to <code>true</code> if the application
428589a1bc0b00e570db079b4b157f60229ad8ef8f9Narayan Kamath     * has reported that it is heavy-weight, and thus can not participate in
429589a1bc0b00e570db079b4b157f60229ad8ef8f9Narayan Kamath     * the normal application lifecycle.
430589a1bc0b00e570db079b4b157f60229ad8ef8f9Narayan Kamath     *
431589a1bc0b00e570db079b4b157f60229ad8ef8f9Narayan Kamath     * <p>Comes from the
432589a1bc0b00e570db079b4b157f60229ad8ef8f9Narayan Kamath     * android.R.styleable#AndroidManifestApplication_cantSaveState
433589a1bc0b00e570db079b4b157f60229ad8ef8f9Narayan Kamath     * attribute of the &lt;application&gt; tag.
4344ce55a3987c14b939cd416e24116c6ab3c760b82Christopher Tate     *
4354ce55a3987c14b939cd416e24116c6ab3c760b82Christopher Tate     * {@hide}
4364ce55a3987c14b939cd416e24116c6ab3c760b82Christopher Tate     */
437b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin    public static final int PRIVATE_FLAG_CANT_SAVE_STATE = 1<<1;
4384ce55a3987c14b939cd416e24116c6ab3c760b82Christopher Tate
4394ce55a3987c14b939cd416e24116c6ab3c760b82Christopher Tate    /**
440b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * Value for {@link #privateFlags}: Set to true if the application has been
4413202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn     * installed using the forward lock option.
442af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu     *
44375e616e8203a540c860888ccff73ffaa87498c5eDianne Hackborn     * NOTE: DO NOT CHANGE THIS VALUE!  It is saved in packages.xml.
444b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     *
445af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu     * {@hide}
446af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu     */
447b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin    public static final int PRIVATE_FLAG_FORWARD_LOCK = 1<<2;
448af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu
449af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu    /**
450b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * Value for {@link #privateFlags}: set to {@code true} if the application
451589a1bc0b00e570db079b4b157f60229ad8ef8f9Narayan Kamath     * is permitted to hold privileged permissions.
45202486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn     *
45302486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn     * {@hide}
45402486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn     */
455b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin    public static final int PRIVATE_FLAG_PRIVILEGED = 1<<3;
45602486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn
45702486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn    /**
458d3d8a32217d5a2d895917cfe7e1645935d228494Fabrice Di Meglio     * Value for {@link #flags}: {@code true} if the application has any IntentFiler with some
459d3d8a32217d5a2d895917cfe7e1645935d228494Fabrice Di Meglio     * data URI using HTTP or HTTPS with an associated VIEW action.
460d3d8a32217d5a2d895917cfe7e1645935d228494Fabrice Di Meglio     *
461d3d8a32217d5a2d895917cfe7e1645935d228494Fabrice Di Meglio     * {@hide}
462d3d8a32217d5a2d895917cfe7e1645935d228494Fabrice Di Meglio     */
463d3d8a32217d5a2d895917cfe7e1645935d228494Fabrice Di Meglio    public static final int PRIVATE_FLAG_HAS_DOMAIN_URLS = 1<<4;
464d3d8a32217d5a2d895917cfe7e1645935d228494Fabrice Di Meglio
465d3d8a32217d5a2d895917cfe7e1645935d228494Fabrice Di Meglio    /**
46615447798a38d2b5acb1998731340255f4203f294Jeff Sharkey     * When set, default data storage directory for given app is pointed at
46715447798a38d2b5acb1998731340255f4203f294Jeff Sharkey     * device-encrypted location.
46815447798a38d2b5acb1998731340255f4203f294Jeff Sharkey     *
46915447798a38d2b5acb1998731340255f4203f294Jeff Sharkey     * @hide
47015447798a38d2b5acb1998731340255f4203f294Jeff Sharkey     */
471e17ac1569793c333bb4dce86607a342e7c982ae7Jeff Sharkey    public static final int PRIVATE_FLAG_FORCE_DEVICE_ENCRYPTED = 1 << 5;
47215447798a38d2b5acb1998731340255f4203f294Jeff Sharkey
47315447798a38d2b5acb1998731340255f4203f294Jeff Sharkey    /**
474f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkey     * When set, assume that all components under the given app are encryption
475f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkey     * aware, unless otherwise specified.
476f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkey     *
477f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkey     * @hide
478f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkey     */
479f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkey    public static final int PRIVATE_FLAG_ENCRYPTION_AWARE = 1 << 6;
480f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkey
481f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkey    /**
482a4407bfceef1bdb7eb4d83990722a61082d926c9Jeff Vander Stoep     * Value for {@link #privateFlags}: set to {@code true} if the application
483a4407bfceef1bdb7eb4d83990722a61082d926c9Jeff Vander Stoep     * is AutoPlay.
484a4407bfceef1bdb7eb4d83990722a61082d926c9Jeff Vander Stoep     *
485a4407bfceef1bdb7eb4d83990722a61082d926c9Jeff Vander Stoep     * {@hide}
486a4407bfceef1bdb7eb4d83990722a61082d926c9Jeff Vander Stoep     */
4879edb7bf4c6f9c59d0c469798d5936019e8199043Jeff Vander Stoep    public static final int PRIVATE_FLAG_AUTOPLAY = 1 << 7;
488a4407bfceef1bdb7eb4d83990722a61082d926c9Jeff Vander Stoep
489a4407bfceef1bdb7eb4d83990722a61082d926c9Jeff Vander Stoep    /**
4908924e8759f9a8cffb5ad538ca40a7826793aac07Jeff Sharkey     * When set, at least one component inside this application is encryption aware.
4918924e8759f9a8cffb5ad538ca40a7826793aac07Jeff Sharkey     *
4928924e8759f9a8cffb5ad538ca40a7826793aac07Jeff Sharkey     * @hide
4938924e8759f9a8cffb5ad538ca40a7826793aac07Jeff Sharkey     */
4948924e8759f9a8cffb5ad538ca40a7826793aac07Jeff Sharkey    public static final int PRIVATE_FLAG_PARTIALLY_ENCRYPTION_AWARE = 1 << 8;
4958924e8759f9a8cffb5ad538ca40a7826793aac07Jeff Sharkey
4968924e8759f9a8cffb5ad538ca40a7826793aac07Jeff Sharkey    /**
497b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * Private/hidden flags. See {@code PRIVATE_FLAG_...} constants.
498b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin     * {@hide}
4999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
500b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin    public int privateFlags;
501655d0e2029e6ae77a47e922dce4c4989818b8dd1Amith Yamasani
5029066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
503df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * The required smallest screen width the application can run on.  If 0,
504df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * nothing has been specified.  Comes from
505df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_requiresSmallestWidthDp
506df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * android:requiresSmallestWidthDp} attribute of the &lt;supports-screens&gt; tag.
507df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     */
508df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn    public int requiresSmallestWidthDp = 0;
509df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn
510df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn    /**
511df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * The maximum smallest screen width the application is designed for.  If 0,
512df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * nothing has been specified.  Comes from
513df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_compatibleWidthLimitDp
514df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * android:compatibleWidthLimitDp} attribute of the &lt;supports-screens&gt; tag.
515df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     */
516df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn    public int compatibleWidthLimitDp = 0;
517df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn
518df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn    /**
5192762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn     * The maximum smallest screen width the application will work on.  If 0,
5202762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn     * nothing has been specified.  Comes from
5212762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_largestWidthLimitDp
5222762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn     * android:largestWidthLimitDp} attribute of the &lt;supports-screens&gt; tag.
5232762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn     */
5242762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn    public int largestWidthLimitDp = 0;
5252762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn
526d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    /** {@hide} */
527b2b9ab8354da1485178cd8d8e9d89ac915b3f269Jeff Sharkey    public String volumeUuid;
528b2b9ab8354da1485178cd8d8e9d89ac915b3f269Jeff Sharkey    /** {@hide} */
529d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    public String scanSourceDir;
530d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    /** {@hide} */
531d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    public String scanPublicSourceDir;
532d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey
5332762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn    /**
5348a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey     * Full path to the base APK for this application.
5359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
5369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String sourceDir;
5379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
5389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
5398a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey     * Full path to the publicly available parts of {@link #sourceDir},
5408a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey     * including resources and manifest. This may be different from
5418a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey     * {@link #sourceDir} if an application is forward locked.
5429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
5439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String publicSourceDir;
5448a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey
5458a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey    /**
5468a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey     * Full paths to zero or more split APKs that, when combined with the base
5478a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey     * APK defined in {@link #sourceDir}, form a complete application.
5488a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey     */
5498a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey    public String[] splitSourceDirs;
5508a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey
5518a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey    /**
5528a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey     * Full path to the publicly available parts of {@link #splitSourceDirs},
5538a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey     * including resources and manifest. This may be different from
5548a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey     * {@link #splitSourceDirs} if an application is forward locked.
5558a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey     */
5568a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey    public String[] splitPublicSourceDirs;
5578a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey
5589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
559d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root     * Full paths to the locations of extra resource packages this application
560d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root     * uses. This field is only used if there are extra resource packages,
561d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root     * otherwise it is null.
562ace5a3fbfbf1b41905410925f1ea007040a7a675Kenny Root     *
563ace5a3fbfbf1b41905410925f1ea007040a7a675Kenny Root     * {@hide}
564d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root     */
565d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root    public String[] resourceDirs;
566d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root
567d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root    /**
5680f40dc923c67e8822f9157aec4f786f73848af07Robert Craig     * String retrieved from the seinfo tag found in selinux policy. This value
5695e16bc5a143b46bbe9a4873adceed85a6241d1d0Robert Craig     * can be overridden with a value set through the mac_permissions.xml policy
5705e16bc5a143b46bbe9a4873adceed85a6241d1d0Robert Craig     * construct. This value is useful in setting an SELinux security context on
5715e16bc5a143b46bbe9a4873adceed85a6241d1d0Robert Craig     * the process as well as its data directory. The String default is being used
5725e16bc5a143b46bbe9a4873adceed85a6241d1d0Robert Craig     * here to represent a catchall label when no policy matches.
5730f40dc923c67e8822f9157aec4f786f73848af07Robert Craig     *
5740f40dc923c67e8822f9157aec4f786f73848af07Robert Craig     * {@hide}
5750f40dc923c67e8822f9157aec4f786f73848af07Robert Craig     */
5765e16bc5a143b46bbe9a4873adceed85a6241d1d0Robert Craig    public String seinfo = "default";
5770f40dc923c67e8822f9157aec4f786f73848af07Robert Craig
5780f40dc923c67e8822f9157aec4f786f73848af07Robert Craig    /**
5799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Paths to all shared libraries this application is linked against.  This
5809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * field is only set if the {@link PackageManager#GET_SHARED_LIBRARY_FILES
5819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * PackageManager.GET_SHARED_LIBRARY_FILES} flag was used when retrieving
5829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * the structure.
5839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
5849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String[] sharedLibraryFiles;
5859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
5869066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
58715447798a38d2b5acb1998731340255f4203f294Jeff Sharkey     * Full path to a directory assigned to the package for its persistent data.
5889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
5899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String dataDir;
59085387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root
59115447798a38d2b5acb1998731340255f4203f294Jeff Sharkey    /** {@hide} */
59215447798a38d2b5acb1998731340255f4203f294Jeff Sharkey    public String deviceEncryptedDataDir;
59315447798a38d2b5acb1998731340255f4203f294Jeff Sharkey    /** {@hide} */
59415447798a38d2b5acb1998731340255f4203f294Jeff Sharkey    public String credentialEncryptedDataDir;
59515447798a38d2b5acb1998731340255f4203f294Jeff Sharkey
59685387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root    /**
59785387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root     * Full path to the directory where native JNI libraries are stored.
59885387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root     */
59985387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root    public String nativeLibraryDir;
60085387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root
6019066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
6027dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath     * Full path where unpacked native libraries for {@link #secondaryCpuAbi}
6037dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath     * are stored, if present.
6047dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath     *
6057dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath     * The main reason this exists is for bundled multi-arch apps, where
6067dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath     * it's not trivial to calculate the location of libs for the secondary abi
6077dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath     * given the location of the primary.
6087dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath     *
6097dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath     * TODO: Change the layout of bundled installs so that we can use
6107dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath     * nativeLibraryRootDir & nativeLibraryRootRequiresIsa there as well.
6117dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath     * (e.g {@code [ "/system/app-lib/Foo/arm", "/system/app-lib/Foo/arm64" ]}
6127dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath     * instead of {@code [ "/system/lib/Foo", "/system/lib64/Foo" ]}.
6137dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath     *
6147dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath     * @hide
6157dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath     */
6167dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath    public String secondaryNativeLibraryDir;
6177dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath
6187dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath    /**
61984f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey     * The root path where unpacked native libraries are stored.
62084f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey     * <p>
62184f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey     * When {@link #nativeLibraryRootRequiresIsa} is set, the libraries are
62284f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey     * placed in ISA-specific subdirectories under this path, otherwise the
62384f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey     * libraries are placed directly at this path.
624ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath     *
62584f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey     * @hide
62684f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey     */
62784f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey    public String nativeLibraryRootDir;
62884f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey
62984f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey    /**
63084f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey     * Flag indicating that ISA must be appended to
63184f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey     * {@link #nativeLibraryRootDir} to be useful.
632ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath     *
63384f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey     * @hide
634ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath     */
63584f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey    public boolean nativeLibraryRootRequiresIsa;
636ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath
637ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath    /**
638ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath     * The primary ABI that this application requires, This is inferred from the ABIs
639ff0c470833b2cb4130a30895093630242d5f238dRamin Zaghi     * of the native JNI libraries the application bundles. Will be {@code null}
640ff0c470833b2cb4130a30895093630242d5f238dRamin Zaghi     * if this application does not require any particular ABI.
641ff0c470833b2cb4130a30895093630242d5f238dRamin Zaghi     *
642ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath     * If non-null, the application will always be launched with this ABI.
643ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath     *
644ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath     * {@hide}
645ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath     */
646ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath    public String primaryCpuAbi;
647ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath
648ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath    /**
649ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath     * The secondary ABI for this application. Might be non-null for multi-arch
650ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath     * installs. The application itself never uses this ABI, but other applications that
651ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath     * use its code might.
652ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath     *
653ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath     * {@hide}
654ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath     */
655ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath    public String secondaryCpuAbi;
656ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath
657ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath    /**
6589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * The kernel user-ID that has been assigned to this application;
6599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * currently this is not a unique ID (multiple applications can have
6609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * the same uid).
6619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
6629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public int uid;
6639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
6648d112675879a2b83197d3b4ae4fb623abd1a1ec3Mitsuru Oshima    /**
6653b3e145d3c41fd68974e08f799b1fd1f8f060cf0Dianne Hackborn     * The minimum SDK version this application targets.  It may run on earlier
666a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn     * versions, but it knows how to work with any new behavior added at this
667a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn     * version.  Will be {@link android.os.Build.VERSION_CODES#CUR_DEVELOPMENT}
668a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn     * if this is a development build and the app is targeting that.  You should
669a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn     * compare that this number is >= the SDK version number at which your
670a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn     * behavior was introduced.
671a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn     */
672a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn    public int targetSdkVersion;
6738472e6189cd4e0520c047bdb28457abc728b373fDianne Hackborn
6748472e6189cd4e0520c047bdb28457abc728b373fDianne Hackborn    /**
6758472e6189cd4e0520c047bdb28457abc728b373fDianne Hackborn     * The app's declared version code.
6768472e6189cd4e0520c047bdb28457abc728b373fDianne Hackborn     * @hide
6778472e6189cd4e0520c047bdb28457abc728b373fDianne Hackborn     */
6788472e6189cd4e0520c047bdb28457abc728b373fDianne Hackborn    public int versionCode;
6798472e6189cd4e0520c047bdb28457abc728b373fDianne Hackborn
680a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn    /**
6819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * When false, indicates that all components within this application are
6829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * considered disabled, regardless of their individually set enabled status.
6839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
6849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public boolean enabled = true;
6859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
68654e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn    /**
6870ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn     * For convenient access to the current enabled setting of this app.
6880ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn     * @hide
6890ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn     */
6900ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn    public int enabledSetting = PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
6910ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn
6920ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn    /**
69354e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn     * For convenient access to package's install location.
69454e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn     * @hide
69554e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn     */
69654e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn    public int installLocation = PackageInfo.INSTALL_LOCATION_UNSPECIFIED;
69712d0b4cd960e18493b1dc237adbfabed432c9df5Jose Lima
6989066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public void dump(Printer pw, String prefix) {
6999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        super.dumpFront(pw, prefix);
70012527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        if (className != null) {
70112527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn            pw.println(prefix + "className=" + className);
70212527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        }
70312527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        if (permission != null) {
70412527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn            pw.println(prefix + "permission=" + permission);
70512527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        }
70639792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn        pw.println(prefix + "processName=" + processName);
70739792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn        pw.println(prefix + "taskAffinity=" + taskAffinity);
70839792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn        pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags)
709b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin                + " privateFlags=0x" + Integer.toHexString(privateFlags)
71039792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn                + " theme=0x" + Integer.toHexString(theme));
711df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn        pw.println(prefix + "requiresSmallestWidthDp=" + requiresSmallestWidthDp
7122762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn                + " compatibleWidthLimitDp=" + compatibleWidthLimitDp
7132762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn                + " largestWidthLimitDp=" + largestWidthLimitDp);
7149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        pw.println(prefix + "sourceDir=" + sourceDir);
7158a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey        if (!Objects.equals(sourceDir, publicSourceDir)) {
71639792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn            pw.println(prefix + "publicSourceDir=" + publicSourceDir);
71739792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn        }
7188a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey        if (!ArrayUtils.isEmpty(splitSourceDirs)) {
7198a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey            pw.println(prefix + "splitSourceDirs=" + Arrays.toString(splitSourceDirs));
7208a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey        }
7218a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey        if (!ArrayUtils.isEmpty(splitPublicSourceDirs)
7228a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey                && !Arrays.equals(splitSourceDirs, splitPublicSourceDirs)) {
7238a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey            pw.println(prefix + "splitPublicSourceDirs=" + Arrays.toString(splitPublicSourceDirs));
7248a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey        }
72539792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn        if (resourceDirs != null) {
72639792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn            pw.println(prefix + "resourceDirs=" + resourceDirs);
72739792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn        }
7280f40dc923c67e8822f9157aec4f786f73848af07Robert Craig        if (seinfo != null) {
7290f40dc923c67e8822f9157aec4f786f73848af07Robert Craig            pw.println(prefix + "seinfo=" + seinfo);
7300f40dc923c67e8822f9157aec4f786f73848af07Robert Craig        }
7319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        pw.println(prefix + "dataDir=" + dataDir);
73215447798a38d2b5acb1998731340255f4203f294Jeff Sharkey        pw.println(prefix + "deviceEncryptedDataDir=" + deviceEncryptedDataDir);
73315447798a38d2b5acb1998731340255f4203f294Jeff Sharkey        pw.println(prefix + "credentialEncryptedDataDir=" + credentialEncryptedDataDir);
73412527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        if (sharedLibraryFiles != null) {
735dcc36bf2a4c0ce863676affcb3cbdd0586a4f888Flavio Lerda            pw.println(prefix + "sharedLibraryFiles=" + Arrays.toString(sharedLibraryFiles));
73612527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        }
7378472e6189cd4e0520c047bdb28457abc728b373fDianne Hackborn        pw.println(prefix + "enabled=" + enabled + " targetSdkVersion=" + targetSdkVersion
7388472e6189cd4e0520c047bdb28457abc728b373fDianne Hackborn                + " versionCode=" + versionCode);
73912527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        if (manageSpaceActivityName != null) {
74012527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn            pw.println(prefix + "manageSpaceActivityName="+manageSpaceActivityName);
74112527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        }
74212527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        if (descriptionRes != 0) {
74312527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn            pw.println(prefix + "description=0x"+Integer.toHexString(descriptionRes));
74412527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        }
745269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell        if (uiOptions != 0) {
746269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell            pw.println(prefix + "uiOptions=0x" + Integer.toHexString(uiOptions));
747269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell        }
74859dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio        pw.println(prefix + "supportsRtl=" + (hasRtlSupport() ? "true" : "false"));
749303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams        if (fullBackupContent > 0) {
750303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams            pw.println(prefix + "fullBackupContent=@xml/" + fullBackupContent);
751303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams        } else {
752303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams            pw.println(prefix + "fullBackupContent=" + (fullBackupContent < 0 ? "false" : "true"));
753303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams        }
7549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        super.dumpBack(pw, prefix);
7559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
75659dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio
75759dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio    /**
75859dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     * @return true if "supportsRtl" has been set to true in the AndroidManifest
75959dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     * @hide
76059dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     */
76159dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio    public boolean hasRtlSupport() {
76259dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio        return (flags & FLAG_SUPPORTS_RTL) == FLAG_SUPPORTS_RTL;
76359dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio    }
7649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
7659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static class DisplayNameComparator
7669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            implements Comparator<ApplicationInfo> {
7679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        public DisplayNameComparator(PackageManager pm) {
7689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            mPM = pm;
7699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
7709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
7719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        public final int compare(ApplicationInfo aa, ApplicationInfo ab) {
7729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            CharSequence  sa = mPM.getApplicationLabel(aa);
7739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            if (sa == null) {
7749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project                sa = aa.packageName;
7759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            }
7769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            CharSequence  sb = mPM.getApplicationLabel(ab);
7779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            if (sb == null) {
7789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project                sb = ab.packageName;
7799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            }
7809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
7819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            return sCollator.compare(sa.toString(), sb.toString());
7829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
7839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
7849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        private final Collator   sCollator = Collator.getInstance();
7859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        private PackageManager   mPM;
7869066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
7879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
7889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public ApplicationInfo() {
7899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
7909066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
7919066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public ApplicationInfo(ApplicationInfo orig) {
7929066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        super(orig);
7939066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        taskAffinity = orig.taskAffinity;
7949066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        permission = orig.permission;
7959066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        processName = orig.processName;
7969066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        className = orig.className;
7979066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        theme = orig.theme;
7989066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        flags = orig.flags;
799b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin        privateFlags = orig.privateFlags;
800df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn        requiresSmallestWidthDp = orig.requiresSmallestWidthDp;
801df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn        compatibleWidthLimitDp = orig.compatibleWidthLimitDp;
8022762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn        largestWidthLimitDp = orig.largestWidthLimitDp;
803b2b9ab8354da1485178cd8d8e9d89ac915b3f269Jeff Sharkey        volumeUuid = orig.volumeUuid;
8047f1a57a3e709b9e1fdb03a7a8af5f13859f7f1adJeff Sharkey        scanSourceDir = orig.scanSourceDir;
8057f1a57a3e709b9e1fdb03a7a8af5f13859f7f1adJeff Sharkey        scanPublicSourceDir = orig.scanPublicSourceDir;
8069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        sourceDir = orig.sourceDir;
8079066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        publicSourceDir = orig.publicSourceDir;
8088a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey        splitSourceDirs = orig.splitSourceDirs;
8098a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey        splitPublicSourceDirs = orig.splitPublicSourceDirs;
81085387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root        nativeLibraryDir = orig.nativeLibraryDir;
8117dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath        secondaryNativeLibraryDir = orig.secondaryNativeLibraryDir;
81284f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey        nativeLibraryRootDir = orig.nativeLibraryRootDir;
81384f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey        nativeLibraryRootRequiresIsa = orig.nativeLibraryRootRequiresIsa;
814ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath        primaryCpuAbi = orig.primaryCpuAbi;
815ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath        secondaryCpuAbi = orig.secondaryCpuAbi;
816d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root        resourceDirs = orig.resourceDirs;
8170f40dc923c67e8822f9157aec4f786f73848af07Robert Craig        seinfo = orig.seinfo;
8189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        sharedLibraryFiles = orig.sharedLibraryFiles;
8199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dataDir = orig.dataDir;
82015447798a38d2b5acb1998731340255f4203f294Jeff Sharkey        deviceEncryptedDataDir = orig.deviceEncryptedDataDir;
82115447798a38d2b5acb1998731340255f4203f294Jeff Sharkey        credentialEncryptedDataDir = orig.credentialEncryptedDataDir;
8229066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        uid = orig.uid;
823a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn        targetSdkVersion = orig.targetSdkVersion;
8248472e6189cd4e0520c047bdb28457abc728b373fDianne Hackborn        versionCode = orig.versionCode;
8259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        enabled = orig.enabled;
8260ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn        enabledSetting = orig.enabledSetting;
82754e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn        installLocation = orig.installLocation;
8289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        manageSpaceActivityName = orig.manageSpaceActivityName;
8299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        descriptionRes = orig.descriptionRes;
830269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell        uiOptions = orig.uiOptions;
831bcb0255770caa6b053da100de13beb840da71b21Christopher Tate        backupAgentName = orig.backupAgentName;
832303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams        fullBackupContent = orig.fullBackupContent;
8339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
8349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
8359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String toString() {
8369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        return "ApplicationInfo{"
8379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            + Integer.toHexString(System.identityHashCode(this))
8389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            + " " + packageName + "}";
8399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
8409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
8419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public int describeContents() {
8429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        return 0;
8439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
8449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
8459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public void writeToParcel(Parcel dest, int parcelableFlags) {
8469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        super.writeToParcel(dest, parcelableFlags);
8479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(taskAffinity);
8489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(permission);
8499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(processName);
8509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(className);
8519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(theme);
8529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(flags);
853b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin        dest.writeInt(privateFlags);
854df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn        dest.writeInt(requiresSmallestWidthDp);
855df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn        dest.writeInt(compatibleWidthLimitDp);
8562762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn        dest.writeInt(largestWidthLimitDp);
857b2b9ab8354da1485178cd8d8e9d89ac915b3f269Jeff Sharkey        dest.writeString(volumeUuid);
8587f1a57a3e709b9e1fdb03a7a8af5f13859f7f1adJeff Sharkey        dest.writeString(scanSourceDir);
8597f1a57a3e709b9e1fdb03a7a8af5f13859f7f1adJeff Sharkey        dest.writeString(scanPublicSourceDir);
8609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(sourceDir);
8619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(publicSourceDir);
8628a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey        dest.writeStringArray(splitSourceDirs);
8638a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey        dest.writeStringArray(splitPublicSourceDirs);
86485387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root        dest.writeString(nativeLibraryDir);
8657dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath        dest.writeString(secondaryNativeLibraryDir);
86684f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey        dest.writeString(nativeLibraryRootDir);
86784f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey        dest.writeInt(nativeLibraryRootRequiresIsa ? 1 : 0);
868ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath        dest.writeString(primaryCpuAbi);
869ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath        dest.writeString(secondaryCpuAbi);
870d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root        dest.writeStringArray(resourceDirs);
8710f40dc923c67e8822f9157aec4f786f73848af07Robert Craig        dest.writeString(seinfo);
8729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeStringArray(sharedLibraryFiles);
8739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(dataDir);
87415447798a38d2b5acb1998731340255f4203f294Jeff Sharkey        dest.writeString(deviceEncryptedDataDir);
87515447798a38d2b5acb1998731340255f4203f294Jeff Sharkey        dest.writeString(credentialEncryptedDataDir);
8769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(uid);
877a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn        dest.writeInt(targetSdkVersion);
8788472e6189cd4e0520c047bdb28457abc728b373fDianne Hackborn        dest.writeInt(versionCode);
8799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(enabled ? 1 : 0);
8800ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn        dest.writeInt(enabledSetting);
88154e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn        dest.writeInt(installLocation);
8829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(manageSpaceActivityName);
883181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate        dest.writeString(backupAgentName);
8849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(descriptionRes);
885269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell        dest.writeInt(uiOptions);
886303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams        dest.writeInt(fullBackupContent);
8879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
8889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
8899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final Parcelable.Creator<ApplicationInfo> CREATOR
8909066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            = new Parcelable.Creator<ApplicationInfo>() {
8919066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        public ApplicationInfo createFromParcel(Parcel source) {
8929066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            return new ApplicationInfo(source);
8939066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
8949066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        public ApplicationInfo[] newArray(int size) {
8959066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            return new ApplicationInfo[size];
8969066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
8979066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    };
8989066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
8999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    private ApplicationInfo(Parcel source) {
9009066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        super(source);
9019066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        taskAffinity = source.readString();
9029066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        permission = source.readString();
9039066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        processName = source.readString();
9049066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        className = source.readString();
9059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        theme = source.readInt();
9069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        flags = source.readInt();
907b9f8a5204a1b0b3919fa921e858d04124c582828Alex Klyubin        privateFlags = source.readInt();
908df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn        requiresSmallestWidthDp = source.readInt();
909df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn        compatibleWidthLimitDp = source.readInt();
9102762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn        largestWidthLimitDp = source.readInt();
911b2b9ab8354da1485178cd8d8e9d89ac915b3f269Jeff Sharkey        volumeUuid = source.readString();
9127f1a57a3e709b9e1fdb03a7a8af5f13859f7f1adJeff Sharkey        scanSourceDir = source.readString();
9137f1a57a3e709b9e1fdb03a7a8af5f13859f7f1adJeff Sharkey        scanPublicSourceDir = source.readString();
9149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        sourceDir = source.readString();
9159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        publicSourceDir = source.readString();
9168a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey        splitSourceDirs = source.readStringArray();
9178a4c9721a9e09d20c63381c13fa29bd9f7cbc3e3Jeff Sharkey        splitPublicSourceDirs = source.readStringArray();
91885387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root        nativeLibraryDir = source.readString();
9197dba6eb3ac4fd6c8195cb0d0425866de50a9e114Narayan Kamath        secondaryNativeLibraryDir = source.readString();
92084f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey        nativeLibraryRootDir = source.readString();
92184f1294a958b42000755dc6570e3eda72ab42140Jeff Sharkey        nativeLibraryRootRequiresIsa = source.readInt() != 0;
922ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath        primaryCpuAbi = source.readString();
923ff110bd61a69f7ed8602ae14b27f7befec76b2e7Narayan Kamath        secondaryCpuAbi = source.readString();
924d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root        resourceDirs = source.readStringArray();
9250f40dc923c67e8822f9157aec4f786f73848af07Robert Craig        seinfo = source.readString();
9269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        sharedLibraryFiles = source.readStringArray();
9279066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dataDir = source.readString();
92815447798a38d2b5acb1998731340255f4203f294Jeff Sharkey        deviceEncryptedDataDir = source.readString();
92915447798a38d2b5acb1998731340255f4203f294Jeff Sharkey        credentialEncryptedDataDir = source.readString();
9309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        uid = source.readInt();
931a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn        targetSdkVersion = source.readInt();
9328472e6189cd4e0520c047bdb28457abc728b373fDianne Hackborn        versionCode = source.readInt();
9339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        enabled = source.readInt() != 0;
9340ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn        enabledSetting = source.readInt();
93554e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn        installLocation = source.readInt();
9369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        manageSpaceActivityName = source.readString();
937181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate        backupAgentName = source.readString();
9389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        descriptionRes = source.readInt();
939269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell        uiOptions = source.readInt();
940303650c9cdb7cec88e7ec20747b161d9fff10719Matthew Williams        fullBackupContent = source.readInt();
9419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
9428d112675879a2b83197d3b4ae4fb623abd1a1ec3Mitsuru Oshima
9439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
9449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Retrieve the textual description of the application.  This
9459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * will call back on the given PackageManager to load the description from
9469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * the application.
9479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     *
9489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * @param pm A PackageManager from which the label can be loaded; usually
9499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * the PackageManager from which you originally retrieved this item.
9509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     *
9519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * @return Returns a CharSequence containing the application's description.
9529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * If there is no description, null is returned.
9539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
9549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public CharSequence loadDescription(PackageManager pm) {
9559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        if (descriptionRes != 0) {
95607330791116513710d879c45b2f095cd314cbfd0Jeff Brown            CharSequence label = pm.getText(packageName, descriptionRes, this);
9579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            if (label != null) {
9589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project                return label;
9599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            }
9609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
9619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        return null;
9629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
963e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima
964e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima    /**
965e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima     * Disable compatibility mode
966e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima     *
967e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima     * @hide
968e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima     */
969e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima    public void disableCompatibilityMode() {
97069fff4a72d4dfc9208db79d773ef3ca23350287eMitsuru Oshima        flags |= (FLAG_SUPPORTS_LARGE_SCREENS | FLAG_SUPPORTS_NORMAL_SCREENS |
97111b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn                FLAG_SUPPORTS_SMALL_SCREENS | FLAG_RESIZEABLE_FOR_SCREENS |
97214cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn                FLAG_SUPPORTS_SCREEN_DENSITIES | FLAG_SUPPORTS_XLARGE_SCREENS);
973e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima    }
97415447798a38d2b5acb1998731340255f4203f294Jeff Sharkey
97515447798a38d2b5acb1998731340255f4203f294Jeff Sharkey    /** {@hide} */
97615447798a38d2b5acb1998731340255f4203f294Jeff Sharkey    public void initForUser(int userId) {
97715447798a38d2b5acb1998731340255f4203f294Jeff Sharkey        uid = UserHandle.getUid(userId, UserHandle.getAppId(uid));
97815447798a38d2b5acb1998731340255f4203f294Jeff Sharkey
97915447798a38d2b5acb1998731340255f4203f294Jeff Sharkey        if ("android".equals(packageName)) {
98015447798a38d2b5acb1998731340255f4203f294Jeff Sharkey            dataDir = Environment.getDataSystemDirectory().getAbsolutePath();
98115447798a38d2b5acb1998731340255f4203f294Jeff Sharkey            return;
98215447798a38d2b5acb1998731340255f4203f294Jeff Sharkey        }
98315447798a38d2b5acb1998731340255f4203f294Jeff Sharkey
98415447798a38d2b5acb1998731340255f4203f294Jeff Sharkey        deviceEncryptedDataDir = Environment
98515447798a38d2b5acb1998731340255f4203f294Jeff Sharkey                .getDataUserDeviceEncryptedPackageDirectory(volumeUuid, userId, packageName)
98615447798a38d2b5acb1998731340255f4203f294Jeff Sharkey                .getAbsolutePath();
98715447798a38d2b5acb1998731340255f4203f294Jeff Sharkey        credentialEncryptedDataDir = Environment
98815447798a38d2b5acb1998731340255f4203f294Jeff Sharkey                .getDataUserCredentialEncryptedPackageDirectory(volumeUuid, userId, packageName)
98915447798a38d2b5acb1998731340255f4203f294Jeff Sharkey                .getAbsolutePath();
99015447798a38d2b5acb1998731340255f4203f294Jeff Sharkey
991f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkey        if ((privateFlags & PRIVATE_FLAG_FORCE_DEVICE_ENCRYPTED) != 0
992ba51235ef5c598d845b77fcf14491329493da34fJeff Sharkey                && StorageManager.isFileBasedEncryptionEnabled()) {
99315447798a38d2b5acb1998731340255f4203f294Jeff Sharkey            dataDir = deviceEncryptedDataDir;
99415447798a38d2b5acb1998731340255f4203f294Jeff Sharkey        } else {
99515447798a38d2b5acb1998731340255f4203f294Jeff Sharkey            dataDir = credentialEncryptedDataDir;
99615447798a38d2b5acb1998731340255f4203f294Jeff Sharkey        }
99715447798a38d2b5acb1998731340255f4203f294Jeff Sharkey    }
99815447798a38d2b5acb1998731340255f4203f294Jeff Sharkey
99907330791116513710d879c45b2f095cd314cbfd0Jeff Brown    /**
100007330791116513710d879c45b2f095cd314cbfd0Jeff Brown     * @hide
100107330791116513710d879c45b2f095cd314cbfd0Jeff Brown     */
1002a709314537164d959a18ee78768c69c4a9cb33c7Alexandra Gherghina    @Override
1003a709314537164d959a18ee78768c69c4a9cb33c7Alexandra Gherghina    public Drawable loadDefaultIcon(PackageManager pm) {
100407330791116513710d879c45b2f095cd314cbfd0Jeff Brown        if ((flags & FLAG_EXTERNAL_STORAGE) != 0
100507330791116513710d879c45b2f095cd314cbfd0Jeff Brown                && isPackageUnavailable(pm)) {
100607330791116513710d879c45b2f095cd314cbfd0Jeff Brown            return Resources.getSystem().getDrawable(
100707330791116513710d879c45b2f095cd314cbfd0Jeff Brown                    com.android.internal.R.drawable.sym_app_on_sd_unavailable_icon);
100807330791116513710d879c45b2f095cd314cbfd0Jeff Brown        }
100907330791116513710d879c45b2f095cd314cbfd0Jeff Brown        return pm.getDefaultActivityIcon();
101007330791116513710d879c45b2f095cd314cbfd0Jeff Brown    }
101107330791116513710d879c45b2f095cd314cbfd0Jeff Brown
101207330791116513710d879c45b2f095cd314cbfd0Jeff Brown    private boolean isPackageUnavailable(PackageManager pm) {
101307330791116513710d879c45b2f095cd314cbfd0Jeff Brown        try {
101407330791116513710d879c45b2f095cd314cbfd0Jeff Brown            return pm.getPackageInfo(packageName, 0) == null;
101507330791116513710d879c45b2f095cd314cbfd0Jeff Brown        } catch (NameNotFoundException ex) {
101607330791116513710d879c45b2f095cd314cbfd0Jeff Brown            return true;
101707330791116513710d879c45b2f095cd314cbfd0Jeff Brown        }
101807330791116513710d879c45b2f095cd314cbfd0Jeff Brown    }
1019d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey
102007330791116513710d879c45b2f095cd314cbfd0Jeff Brown    /**
102107330791116513710d879c45b2f095cd314cbfd0Jeff Brown     * @hide
102207330791116513710d879c45b2f095cd314cbfd0Jeff Brown     */
1023eeea67b8c3678d882d3774edc41242c63daa60faFyodor Kupolov    public boolean isForwardLocked() {
1024eeea67b8c3678d882d3774edc41242c63daa60faFyodor Kupolov        return (privateFlags & ApplicationInfo.PRIVATE_FLAG_FORWARD_LOCK) != 0;
1025eeea67b8c3678d882d3774edc41242c63daa60faFyodor Kupolov    }
1026eeea67b8c3678d882d3774edc41242c63daa60faFyodor Kupolov
1027eeea67b8c3678d882d3774edc41242c63daa60faFyodor Kupolov    /**
1028eeea67b8c3678d882d3774edc41242c63daa60faFyodor Kupolov     * @hide
1029eeea67b8c3678d882d3774edc41242c63daa60faFyodor Kupolov     */
1030b94c1657eb0140f7b91f5372a9f76de5a3d87e36Fyodor Kupolov    public boolean isSystemApp() {
1031b94c1657eb0140f7b91f5372a9f76de5a3d87e36Fyodor Kupolov        return (flags & ApplicationInfo.FLAG_SYSTEM) != 0;
1032b94c1657eb0140f7b91f5372a9f76de5a3d87e36Fyodor Kupolov    }
1033b94c1657eb0140f7b91f5372a9f76de5a3d87e36Fyodor Kupolov
1034b94c1657eb0140f7b91f5372a9f76de5a3d87e36Fyodor Kupolov    /**
1035b94c1657eb0140f7b91f5372a9f76de5a3d87e36Fyodor Kupolov     * @hide
1036b94c1657eb0140f7b91f5372a9f76de5a3d87e36Fyodor Kupolov     */
1037adc1cf46045ae756d3a9ccbccf6b0f894e4c1eddSvet Ganov    public boolean isPrivilegedApp() {
1038adc1cf46045ae756d3a9ccbccf6b0f894e4c1eddSvet Ganov        return (privateFlags & ApplicationInfo.PRIVATE_FLAG_PRIVILEGED) != 0;
1039adc1cf46045ae756d3a9ccbccf6b0f894e4c1eddSvet Ganov    }
1040adc1cf46045ae756d3a9ccbccf6b0f894e4c1eddSvet Ganov
1041adc1cf46045ae756d3a9ccbccf6b0f894e4c1eddSvet Ganov    /**
1042adc1cf46045ae756d3a9ccbccf6b0f894e4c1eddSvet Ganov     * @hide
1043adc1cf46045ae756d3a9ccbccf6b0f894e4c1eddSvet Ganov     */
1044b94c1657eb0140f7b91f5372a9f76de5a3d87e36Fyodor Kupolov    public boolean isUpdatedSystemApp() {
1045b94c1657eb0140f7b91f5372a9f76de5a3d87e36Fyodor Kupolov        return (flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0;
1046b94c1657eb0140f7b91f5372a9f76de5a3d87e36Fyodor Kupolov    }
1047b94c1657eb0140f7b91f5372a9f76de5a3d87e36Fyodor Kupolov
1048e2d45be4dae116307f8edd85eaa61134221cb8f9Jeff Sharkey    /** @hide */
1049e2d45be4dae116307f8edd85eaa61134221cb8f9Jeff Sharkey    public boolean isInternal() {
1050e2d45be4dae116307f8edd85eaa61134221cb8f9Jeff Sharkey        return (flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) == 0;
1051e2d45be4dae116307f8edd85eaa61134221cb8f9Jeff Sharkey    }
1052e2d45be4dae116307f8edd85eaa61134221cb8f9Jeff Sharkey
1053e2d45be4dae116307f8edd85eaa61134221cb8f9Jeff Sharkey    /** @hide */
1054e2d45be4dae116307f8edd85eaa61134221cb8f9Jeff Sharkey    public boolean isExternalAsec() {
1055e2d45be4dae116307f8edd85eaa61134221cb8f9Jeff Sharkey        return TextUtils.isEmpty(volumeUuid)
1056e2d45be4dae116307f8edd85eaa61134221cb8f9Jeff Sharkey                && (flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0;
1057e2d45be4dae116307f8edd85eaa61134221cb8f9Jeff Sharkey    }
1058e2d45be4dae116307f8edd85eaa61134221cb8f9Jeff Sharkey
1059f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkey    /** @hide */
1060f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkey    public boolean isEncryptionAware() {
1061f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkey        return (privateFlags & ApplicationInfo.PRIVATE_FLAG_ENCRYPTION_AWARE) != 0;
1062f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkey    }
1063f9fc6d6cc05595241bc7ced6d4cab97b45f9b901Jeff Sharkey
10648924e8759f9a8cffb5ad538ca40a7826793aac07Jeff Sharkey    /** @hide */
10658924e8759f9a8cffb5ad538ca40a7826793aac07Jeff Sharkey    public boolean isPartiallyEncryptionAware() {
10668924e8759f9a8cffb5ad538ca40a7826793aac07Jeff Sharkey        return (privateFlags & ApplicationInfo.PRIVATE_FLAG_PARTIALLY_ENCRYPTION_AWARE) != 0;
10678924e8759f9a8cffb5ad538ca40a7826793aac07Jeff Sharkey    }
10688924e8759f9a8cffb5ad538ca40a7826793aac07Jeff Sharkey
1069b94c1657eb0140f7b91f5372a9f76de5a3d87e36Fyodor Kupolov    /**
1070b94c1657eb0140f7b91f5372a9f76de5a3d87e36Fyodor Kupolov     * @hide
1071b94c1657eb0140f7b91f5372a9f76de5a3d87e36Fyodor Kupolov     */
1072a4407bfceef1bdb7eb4d83990722a61082d926c9Jeff Vander Stoep    public boolean isAutoPlayApp() {
1073a4407bfceef1bdb7eb4d83990722a61082d926c9Jeff Vander Stoep        return (privateFlags & ApplicationInfo.PRIVATE_FLAG_AUTOPLAY) != 0;
1074a4407bfceef1bdb7eb4d83990722a61082d926c9Jeff Vander Stoep    }
1075a4407bfceef1bdb7eb4d83990722a61082d926c9Jeff Vander Stoep
1076a4407bfceef1bdb7eb4d83990722a61082d926c9Jeff Vander Stoep    /**
1077a4407bfceef1bdb7eb4d83990722a61082d926c9Jeff Vander Stoep     * @hide
1078a4407bfceef1bdb7eb4d83990722a61082d926c9Jeff Vander Stoep     */
107907330791116513710d879c45b2f095cd314cbfd0Jeff Brown    @Override protected ApplicationInfo getApplicationInfo() {
108007330791116513710d879c45b2f095cd314cbfd0Jeff Brown        return this;
108107330791116513710d879c45b2f095cd314cbfd0Jeff Brown    }
1082d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey
1083d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    /** {@hide} */ public void setCodePath(String codePath) { scanSourceDir = codePath; }
1084d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    /** {@hide} */ public void setBaseCodePath(String baseCodePath) { sourceDir = baseCodePath; }
1085d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    /** {@hide} */ public void setSplitCodePaths(String[] splitCodePaths) { splitSourceDirs = splitCodePaths; }
1086d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    /** {@hide} */ public void setResourcePath(String resourcePath) { scanPublicSourceDir = resourcePath; }
1087d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    /** {@hide} */ public void setBaseResourcePath(String baseResourcePath) { publicSourceDir = baseResourcePath; }
1088d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    /** {@hide} */ public void setSplitResourcePaths(String[] splitResourcePaths) { splitPublicSourceDirs = splitResourcePaths; }
1089d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey
1090d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    /** {@hide} */ public String getCodePath() { return scanSourceDir; }
1091d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    /** {@hide} */ public String getBaseCodePath() { return sourceDir; }
1092d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    /** {@hide} */ public String[] getSplitCodePaths() { return splitSourceDirs; }
1093d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    /** {@hide} */ public String getResourcePath() { return scanPublicSourceDir; }
1094d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    /** {@hide} */ public String getBaseResourcePath() { return publicSourceDir; }
1095d746057f2414cba2bdc69257cc5be8cb681bb592Jeff Sharkey    /** {@hide} */ public String[] getSplitResourcePaths() { return splitSourceDirs; }
10969066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project}
1097