ApplicationInfo.java revision 12d0b4cd960e18493b1dc237adbfabed432c9df5
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;
229066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.os.Parcel;
239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.os.Parcelable;
249066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.util.Printer;
259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport java.text.Collator;
279066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport java.util.Comparator;
289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/**
309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Information you can retrieve about a particular application.  This
319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * corresponds to information collected from the AndroidManifest.xml's
329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * <application> tag.
339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */
349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpublic class ApplicationInfo extends PackageItemInfo implements Parcelable {
359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Default task affinity of all activities in this application. See
389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * {@link ActivityInfo#taskAffinity} for more information.  This comes
399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * from the "taskAffinity" attribute.
409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String taskAffinity;
429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Optional name of a permission required to be able to access this
459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * application's components.  From the "permission" attribute.
469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String permission;
489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * The name of the process this application should run in.  From the
519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * "process" attribute or, if not set, the same as
529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * <var>packageName</var>.
539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String processName;
559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Class implementing the Application object.  From the "class"
589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * attribute.
599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String className;
619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * A style resource identifier (in the package's resources) of the
649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * description of an application.  From the "description" attribute
659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * or, if not set, 0.
669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public int descriptionRes;
689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * A style resource identifier (in the package's resources) of the
719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * default visual theme of the application.  From the "theme" attribute
729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * or, if not set, 0.
739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public int theme;
759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Class implementing the Application's manage space
789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * functionality.  From the "manageSpaceActivity"
799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * attribute. This is an optional attribute and will be null if
80181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * applications don't specify it in their manifest
819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String manageSpaceActivityName;
839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
85181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * Class implementing the Application's backup functionality.  From
86181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * the "backupAgent" attribute.  This is an optional attribute and
87181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * will be null if the application does not specify it in its manifest.
88181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     *
89181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * <p>If android:allowBackup is set to false, this attribute is ignored.
90181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     */
91181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate    public String backupAgentName;
924a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate
934a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate    /**
94269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell     * The default extra UI options for activities in this application.
95269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell     * Set from the {@link android.R.attr#uiOptions} attribute in the
96269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell     * activity's manifest.
97269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell     */
98269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell    public int uiOptions = 0;
99269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell
100269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell    /**
1019066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Value for {@link #flags}: if set, this application is installed in the
1029066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * device's system image.
1039066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1049066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_SYSTEM = 1<<0;
1059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
1079066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Value for {@link #flags}: set to true if this application would like to
1089066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * allow debugging of its
1099066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * code, even when installed on a non-development system.  Comes
1109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * from {@link android.R.styleable#AndroidManifestApplication_debuggable
1119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * android:debuggable} of the &lt;application&gt; tag.
1129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_DEBUGGABLE = 1<<1;
1149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
1169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Value for {@link #flags}: set to true if this application has code
1179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * associated with it.  Comes
1189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * from {@link android.R.styleable#AndroidManifestApplication_hasCode
1199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * android:hasCode} of the &lt;application&gt; tag.
1209066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_HAS_CODE = 1<<2;
1229066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
1249066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Value for {@link #flags}: set to true if this application is persistent.
1259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Comes from {@link android.R.styleable#AndroidManifestApplication_persistent
1269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * android:persistent} of the &lt;application&gt; tag.
1279066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_PERSISTENT = 1<<3;
1299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
131181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * Value for {@link #flags}: set to true if this application holds the
1329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * {@link android.Manifest.permission#FACTORY_TEST} permission and the
1339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * device is running in factory test mode.
1349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_FACTORY_TEST = 1<<4;
1369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
1389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Value for {@link #flags}: default value for the corresponding ActivityInfo flag.
1399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Comes from {@link android.R.styleable#AndroidManifestApplication_allowTaskReparenting
1409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * android:allowTaskReparenting} of the &lt;application&gt; tag.
1419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_ALLOW_TASK_REPARENTING = 1<<5;
1439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
1459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Value for {@link #flags}: default value for the corresponding ActivityInfo flag.
1469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Comes from {@link android.R.styleable#AndroidManifestApplication_allowClearUserData
1479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * android:allowClearUserData} of the &lt;application&gt; tag.
1489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_ALLOW_CLEAR_USER_DATA = 1<<6;
1509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
152851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn     * Value for {@link #flags}: this is set if this application has been
153851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn     * install as an update to a built-in system application.
1549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
1559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final int FLAG_UPDATED_SYSTEM_APP = 1<<7;
156851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn
157851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn    /**
1587f2054392e9957d3ba8579ef08c29cfb27df564eDianne Hackborn     * Value for {@link #flags}: this is set of the application has specified
1597f2054392e9957d3ba8579ef08c29cfb27df564eDianne Hackborn     * {@link android.R.styleable#AndroidManifestApplication_testOnly
1607f2054392e9957d3ba8579ef08c29cfb27df564eDianne Hackborn     * android:testOnly} to be true.
161851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn     */
162a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn    public static final int FLAG_TEST_ONLY = 1<<8;
163ade3ecad94d1f4431576f53bae26c35efbf7a2c9Dianne Hackborn
164ade3ecad94d1f4431576f53bae26c35efbf7a2c9Dianne Hackborn    /**
1655c1e00b14d2ef10ec76abf3e951fa8003a67f558Dianne Hackborn     * Value for {@link #flags}: true when the application's window can be
166723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * reduced in size for smaller screens.  Corresponds to
167723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_smallScreens
168723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * android:smallScreens}.
1695c1e00b14d2ef10ec76abf3e951fa8003a67f558Dianne Hackborn     */
170723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn    public static final int FLAG_SUPPORTS_SMALL_SCREENS = 1<<9;
171723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn
172723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn    /**
173723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * Value for {@link #flags}: true when the application's window can be
174723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * displayed on normal screens.  Corresponds to
175723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_normalScreens
176723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * android:normalScreens}.
177723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     */
178723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn    public static final int FLAG_SUPPORTS_NORMAL_SCREENS = 1<<10;
179723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn
180723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn    /**
181723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * Value for {@link #flags}: true when the application's window can be
182723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * increased in size for larger screens.  Corresponds to
183723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_largeScreens
18422ec9ab3b881d71866279ba9363c644a9e4e7164Dianne Hackborn     * android:largeScreens}.
185723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     */
186723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn    public static final int FLAG_SUPPORTS_LARGE_SCREENS = 1<<11;
1875c1e00b14d2ef10ec76abf3e951fa8003a67f558Dianne Hackborn
1885c1e00b14d2ef10ec76abf3e951fa8003a67f558Dianne Hackborn    /**
189c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn     * Value for {@link #flags}: true when the application knows how to adjust
190c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn     * its UI for different screen sizes.  Corresponds to
191c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_resizeable
192c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn     * android:resizeable}.
193c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn     */
194c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn    public static final int FLAG_RESIZEABLE_FOR_SCREENS = 1<<12;
195c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn
196c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn    /**
19711b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn     * Value for {@link #flags}: true when the application knows how to
19811b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn     * accomodate different screen densities.  Corresponds to
19911b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_anyDensity
20011b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn     * android:anyDensity}.
20111b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn     */
20211b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn    public static final int FLAG_SUPPORTS_SCREEN_DENSITIES = 1<<13;
20311b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn
20411b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn    /**
20523085b781e145ed684e7270af1d5ced6800b8effBen Cheng     * Value for {@link #flags}: set to true if this application would like to
20623085b781e145ed684e7270af1d5ced6800b8effBen Cheng     * request the VM to operate under the safe mode. Comes from
207ef3f5ddc2137ed99e41f00441b688fb56b855179Ben Cheng     * {@link android.R.styleable#AndroidManifestApplication_vmSafeMode
208ef3f5ddc2137ed99e41f00441b688fb56b855179Ben Cheng     * android:vmSafeMode} of the &lt;application&gt; tag.
20923085b781e145ed684e7270af1d5ced6800b8effBen Cheng     */
21023085b781e145ed684e7270af1d5ced6800b8effBen Cheng    public static final int FLAG_VM_SAFE_MODE = 1<<14;
21123085b781e145ed684e7270af1d5ced6800b8effBen Cheng
21223085b781e145ed684e7270af1d5ced6800b8effBen Cheng    /**
2133de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * Value for {@link #flags}: set to <code>false</code> if the application does not wish
2143de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * to permit any OS-driven backups of its data; <code>true</code> otherwise.
215181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     *
2163de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * <p>Comes from the
2173de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup}
2183de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * attribute of the &lt;application&gt; tag.
219181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     */
22023085b781e145ed684e7270af1d5ced6800b8effBen Cheng    public static final int FLAG_ALLOW_BACKUP = 1<<15;
2215e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate
2225e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate    /**
2233de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * Value for {@link #flags}: set to <code>false</code> if the application must be kept
2243de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * in memory following a full-system restore operation; <code>true</code> otherwise.
2253de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * Ordinarily, during a full system restore operation each application is shut down
2263de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * following execution of its agent's onRestore() method.  Setting this attribute to
2273de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * <code>false</code> prevents this.  Most applications will not need to set this attribute.
2285e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     *
2293de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * <p>If
2303de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup}
2313de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * is set to <code>false</code> or no
2323de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * {@link android.R.styleable#AndroidManifestApplication_backupAgent android:backupAgent}
2335e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     * is specified, this flag will be ignored.
2345e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     *
2353de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * <p>Comes from the
2363de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * {@link android.R.styleable#AndroidManifestApplication_killAfterRestore android:killAfterRestore}
2373de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * attribute of the &lt;application&gt; tag.
2385e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     */
23923085b781e145ed684e7270af1d5ced6800b8effBen Cheng    public static final int FLAG_KILL_AFTER_RESTORE = 1<<16;
2405e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate
2415e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate    /**
2423de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * Value for {@link #flags}: Set to <code>true</code> if the application's backup
2433de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * agent claims to be able to handle restore data even "from the future,"
2443de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * i.e. from versions of the application with a versionCode greater than
2453de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * the one currently installed on the device.  <i>Use with caution!</i>  By default
2463de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * this attribute is <code>false</code> and the Backup Manager will ensure that data
2473de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * from "future" versions of the application are never supplied during a restore operation.
2485e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     *
2493de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * <p>If
2503de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup}
2513de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * is set to <code>false</code> or no
2523de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * {@link android.R.styleable#AndroidManifestApplication_backupAgent android:backupAgent}
2535e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     * is specified, this flag will be ignored.
2545e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     *
2553de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * <p>Comes from the
2563de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * {@link android.R.styleable#AndroidManifestApplication_restoreAnyVersion android:restoreAnyVersion}
2573de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate     * attribute of the &lt;application&gt; tag.
2585e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate     */
2593de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate    public static final int FLAG_RESTORE_ANY_VERSION = 1<<17;
2605e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate
261181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate    /**
2623202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn     * Value for {@link #flags}: Set to true if the application is
2633202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn     * currently installed on external/removable/unprotected storage.  Such
2643202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn     * applications may not be available if their storage is not currently
2653202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn     * mounted.  When the storage it is on is not available, it will look like
2663202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn     * the application has been uninstalled (its .apk is no longer available)
2673202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn     * but its persistent data is not removed.
268af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu     */
26994c567e1e344d49168603f5a0560215a4ce735e6Dianne Hackborn    public static final int FLAG_EXTERNAL_STORAGE = 1<<18;
270af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu
271af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu    /**
27214cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn     * Value for {@link #flags}: true when the application's window can be
27314cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn     * increased in size for extra large screens.  Corresponds to
27414cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_xlargeScreens
27522ec9ab3b881d71866279ba9363c644a9e4e7164Dianne Hackborn     * android:xlargeScreens}.
27614cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn     */
27714cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn    public static final int FLAG_SUPPORTS_XLARGE_SCREENS = 1<<19;
27814cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn
27914cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn    /**
2803b81bc18bb661c02ad8074c39dab16644c1e65d0Dianne Hackborn     * Value for {@link #flags}: true when the application has requested a
2813b81bc18bb661c02ad8074c39dab16644c1e65d0Dianne Hackborn     * large heap for its processes.  Corresponds to
2823b81bc18bb661c02ad8074c39dab16644c1e65d0Dianne Hackborn     * {@link android.R.styleable#AndroidManifestApplication_largeHeap
2833b81bc18bb661c02ad8074c39dab16644c1e65d0Dianne Hackborn     * android:largeHeap}.
284a3cdaa5337fa573c4c61770195d6232c2e587090Jason parks     */
2853b81bc18bb661c02ad8074c39dab16644c1e65d0Dianne Hackborn    public static final int FLAG_LARGE_HEAP = 1<<20;
286a3cdaa5337fa573c4c61770195d6232c2e587090Jason parks
287a3cdaa5337fa573c4c61770195d6232c2e587090Jason parks    /**
288e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn     * Value for {@link #flags}: true if this application's package is in
289e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn     * the stopped state.
290e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn     */
291e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn    public static final int FLAG_STOPPED = 1<<21;
292e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn
293e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn    /**
29459dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     * Value for {@link #flags}: true  when the application is willing to support
29559dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     * RTL (right to left). All activities will inherit this value.
29659dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     *
29759dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     * Set from the {@link android.R.attr#supportsRtl} attribute in the
29859dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     * activity's manifest.
29959dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     *
30059dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     * Default value is false (no support for RTL).
30159dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     */
30259dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio    public static final int FLAG_SUPPORTS_RTL = 1<<22;
30359dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio
30459dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio    /**
3057767eac3232ba2fb9828766813cdb481d6a97584Dianne Hackborn     * Value for {@link #flags}: true if the application is currently
3067767eac3232ba2fb9828766813cdb481d6a97584Dianne Hackborn     * installed for the calling user.
3077767eac3232ba2fb9828766813cdb481d6a97584Dianne Hackborn     */
3087767eac3232ba2fb9828766813cdb481d6a97584Dianne Hackborn    public static final int FLAG_INSTALLED = 1<<23;
3097767eac3232ba2fb9828766813cdb481d6a97584Dianne Hackborn
3107767eac3232ba2fb9828766813cdb481d6a97584Dianne Hackborn    /**
3115e03e2ca7d25b899b129baad2dd5eca6bf99d88aDianne Hackborn     * Value for {@link #flags}: true if the application only has its
3125e03e2ca7d25b899b129baad2dd5eca6bf99d88aDianne Hackborn     * data installed; the application package itself does not currently
3135e03e2ca7d25b899b129baad2dd5eca6bf99d88aDianne Hackborn     * exist on the device.
3145e03e2ca7d25b899b129baad2dd5eca6bf99d88aDianne Hackborn     */
3155e03e2ca7d25b899b129baad2dd5eca6bf99d88aDianne Hackborn    public static final int FLAG_IS_DATA_ONLY = 1<<24;
3165e03e2ca7d25b899b129baad2dd5eca6bf99d88aDianne Hackborn
3175e03e2ca7d25b899b129baad2dd5eca6bf99d88aDianne Hackborn    /**
31812d0b4cd960e18493b1dc237adbfabed432c9df5Jose Lima     * Value for {@link #flags}: true if the application was declared to be a game, or
31912d0b4cd960e18493b1dc237adbfabed432c9df5Jose Lima     * false if it is a non-game application.
32012d0b4cd960e18493b1dc237adbfabed432c9df5Jose Lima     */
32112d0b4cd960e18493b1dc237adbfabed432c9df5Jose Lima    public static final int FLAG_IS_GAME = 1<<25;
32212d0b4cd960e18493b1dc237adbfabed432c9df5Jose Lima
32312d0b4cd960e18493b1dc237adbfabed432c9df5Jose Lima    /**
3244ce55a3987c14b939cd416e24116c6ab3c760b82Christopher Tate     * Value for {@link #flags}: set to {@code true} if the application
3254ce55a3987c14b939cd416e24116c6ab3c760b82Christopher Tate     * is permitted to hold privileged permissions.
3264ce55a3987c14b939cd416e24116c6ab3c760b82Christopher Tate     *
3274ce55a3987c14b939cd416e24116c6ab3c760b82Christopher Tate     * {@hide}
3284ce55a3987c14b939cd416e24116c6ab3c760b82Christopher Tate     */
3294ce55a3987c14b939cd416e24116c6ab3c760b82Christopher Tate    public static final int FLAG_PRIVILEGED = 1<<30;
3304ce55a3987c14b939cd416e24116c6ab3c760b82Christopher Tate
3314ce55a3987c14b939cd416e24116c6ab3c760b82Christopher Tate    /**
3323202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn     * Value for {@link #flags}: Set to true if the application has been
3333202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn     * installed using the forward lock option.
334af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu     *
33575e616e8203a540c860888ccff73ffaa87498c5eDianne Hackborn     * NOTE: DO NOT CHANGE THIS VALUE!  It is saved in packages.xml.
33675e616e8203a540c860888ccff73ffaa87498c5eDianne Hackborn     *
337af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu     * {@hide}
338af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu     */
33975e616e8203a540c860888ccff73ffaa87498c5eDianne Hackborn    public static final int FLAG_FORWARD_LOCK = 1<<29;
340af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu
341af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu    /**
34202486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn     * Value for {@link #flags}: set to <code>true</code> if the application
34302486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn     * has reported that it is heavy-weight, and thus can not participate in
34402486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn     * the normal application lifecycle.
34502486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn     *
34602486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn     * <p>Comes from the
34754e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn     * {@link android.R.styleable#AndroidManifestApplication_cantSaveState android:cantSaveState}
34802486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn     * attribute of the &lt;application&gt; tag.
34902486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn     *
35002486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn     * {@hide}
35102486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn     */
35275e616e8203a540c860888ccff73ffaa87498c5eDianne Hackborn    public static final int FLAG_CANT_SAVE_STATE = 1<<28;
35302486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn
35402486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn    /**
355655d0e2029e6ae77a47e922dce4c4989818b8dd1Amith Yamasani     * Value for {@link #flags}: true if the application is blocked via restrictions and for
356655d0e2029e6ae77a47e922dce4c4989818b8dd1Amith Yamasani     * most purposes is considered as not installed.
357655d0e2029e6ae77a47e922dce4c4989818b8dd1Amith Yamasani     * {@hide}
358655d0e2029e6ae77a47e922dce4c4989818b8dd1Amith Yamasani     */
359655d0e2029e6ae77a47e922dce4c4989818b8dd1Amith Yamasani    public static final int FLAG_BLOCKED = 1<<27;
360655d0e2029e6ae77a47e922dce4c4989818b8dd1Amith Yamasani
361655d0e2029e6ae77a47e922dce4c4989818b8dd1Amith Yamasani    /**
3629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Flags associated with the application.  Any combination of
3639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE},
3649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * {@link #FLAG_PERSISTENT}, {@link #FLAG_FACTORY_TEST}, and
3659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * {@link #FLAG_ALLOW_TASK_REPARENTING}
366851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn     * {@link #FLAG_ALLOW_CLEAR_USER_DATA}, {@link #FLAG_UPDATED_SYSTEM_APP},
367723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * {@link #FLAG_TEST_ONLY}, {@link #FLAG_SUPPORTS_SMALL_SCREENS},
368723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn     * {@link #FLAG_SUPPORTS_NORMAL_SCREENS},
36914cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn     * {@link #FLAG_SUPPORTS_LARGE_SCREENS}, {@link #FLAG_SUPPORTS_XLARGE_SCREENS},
37014cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn     * {@link #FLAG_RESIZEABLE_FOR_SCREENS},
3717767eac3232ba2fb9828766813cdb481d6a97584Dianne Hackborn     * {@link #FLAG_SUPPORTS_SCREEN_DENSITIES}, {@link #FLAG_VM_SAFE_MODE},
37212d0b4cd960e18493b1dc237adbfabed432c9df5Jose Lima     * {@link #FLAG_INSTALLED}, {@link #FLAG_IS_GAME}.
3739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
3749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public int flags = 0;
375655d0e2029e6ae77a47e922dce4c4989818b8dd1Amith Yamasani
3769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
377df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * The required smallest screen width the application can run on.  If 0,
378df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * nothing has been specified.  Comes from
379df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_requiresSmallestWidthDp
380df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * android:requiresSmallestWidthDp} attribute of the &lt;supports-screens&gt; tag.
381df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     */
382df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn    public int requiresSmallestWidthDp = 0;
383df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn
384df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn    /**
385df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * The maximum smallest screen width the application is designed for.  If 0,
386df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * nothing has been specified.  Comes from
387df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_compatibleWidthLimitDp
388df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     * android:compatibleWidthLimitDp} attribute of the &lt;supports-screens&gt; tag.
389df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn     */
390df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn    public int compatibleWidthLimitDp = 0;
391df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn
392df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn    /**
3932762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn     * The maximum smallest screen width the application will work on.  If 0,
3942762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn     * nothing has been specified.  Comes from
3952762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn     * {@link android.R.styleable#AndroidManifestSupportsScreens_largestWidthLimitDp
3962762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn     * android:largestWidthLimitDp} attribute of the &lt;supports-screens&gt; tag.
3972762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn     */
3982762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn    public int largestWidthLimitDp = 0;
3992762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn
4002762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn    /**
4019066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Full path to the location of this package.
4029066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
4039066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String sourceDir;
4049066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
4059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
406d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root     * Full path to the location of the publicly available parts of this
407d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root     * package (i.e. the primary resource package and manifest).  For
408d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root     * non-forward-locked apps this will be the same as {@link #sourceDir).
4099066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
4109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String publicSourceDir;
4119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
4129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
413d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root     * Full paths to the locations of extra resource packages this application
414d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root     * uses. This field is only used if there are extra resource packages,
415d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root     * otherwise it is null.
416ace5a3fbfbf1b41905410925f1ea007040a7a675Kenny Root     *
417ace5a3fbfbf1b41905410925f1ea007040a7a675Kenny Root     * {@hide}
418d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root     */
419d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root    public String[] resourceDirs;
420d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root
421d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root    /**
4220f40dc923c67e8822f9157aec4f786f73848af07Robert Craig     * String retrieved from the seinfo tag found in selinux policy. This value
4230f40dc923c67e8822f9157aec4f786f73848af07Robert Craig     * is useful in setting an SELinux security context on the process as well
4240f40dc923c67e8822f9157aec4f786f73848af07Robert Craig     * as its data directory.
4250f40dc923c67e8822f9157aec4f786f73848af07Robert Craig     *
4260f40dc923c67e8822f9157aec4f786f73848af07Robert Craig     * {@hide}
4270f40dc923c67e8822f9157aec4f786f73848af07Robert Craig     */
4280f40dc923c67e8822f9157aec4f786f73848af07Robert Craig    public String seinfo;
4290f40dc923c67e8822f9157aec4f786f73848af07Robert Craig
4300f40dc923c67e8822f9157aec4f786f73848af07Robert Craig    /**
4319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Paths to all shared libraries this application is linked against.  This
4329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * field is only set if the {@link PackageManager#GET_SHARED_LIBRARY_FILES
4339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * PackageManager.GET_SHARED_LIBRARY_FILES} flag was used when retrieving
4349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * the structure.
4359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
4369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String[] sharedLibraryFiles;
4379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
4389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
4399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Full path to a directory assigned to the package for its persistent
4409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * data.
4419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
4429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String dataDir;
44385387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root
44485387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root    /**
44585387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root     * Full path to the directory where native JNI libraries are stored.
44685387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root     */
44785387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root    public String nativeLibraryDir;
44885387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root
4499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
4509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * The kernel user-ID that has been assigned to this application;
4519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * currently this is not a unique ID (multiple applications can have
4529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * the same uid).
4539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
4549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public int uid;
4559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
4568d112675879a2b83197d3b4ae4fb623abd1a1ec3Mitsuru Oshima    /**
4573b3e145d3c41fd68974e08f799b1fd1f8f060cf0Dianne Hackborn     * The minimum SDK version this application targets.  It may run on earlier
458a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn     * versions, but it knows how to work with any new behavior added at this
459a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn     * version.  Will be {@link android.os.Build.VERSION_CODES#CUR_DEVELOPMENT}
460a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn     * if this is a development build and the app is targeting that.  You should
461a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn     * compare that this number is >= the SDK version number at which your
462a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn     * behavior was introduced.
463a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn     */
464a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn    public int targetSdkVersion;
465a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn
466a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn    /**
4679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * When false, indicates that all components within this application are
4689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * considered disabled, regardless of their individually set enabled status.
4699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
4709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public boolean enabled = true;
4719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
47254e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn    /**
4730ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn     * For convenient access to the current enabled setting of this app.
4740ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn     * @hide
4750ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn     */
4760ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn    public int enabledSetting = PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
4770ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn
4780ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn    /**
47954e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn     * For convenient access to package's install location.
48054e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn     * @hide
48154e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn     */
48254e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn    public int installLocation = PackageInfo.INSTALL_LOCATION_UNSPECIFIED;
48312d0b4cd960e18493b1dc237adbfabed432c9df5Jose Lima
4849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public void dump(Printer pw, String prefix) {
4859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        super.dumpFront(pw, prefix);
48612527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        if (className != null) {
48712527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn            pw.println(prefix + "className=" + className);
48812527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        }
48912527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        if (permission != null) {
49012527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn            pw.println(prefix + "permission=" + permission);
49112527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        }
49239792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn        pw.println(prefix + "processName=" + processName);
49339792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn        pw.println(prefix + "taskAffinity=" + taskAffinity);
49439792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn        pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags)
49539792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn                + " theme=0x" + Integer.toHexString(theme));
496df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn        pw.println(prefix + "requiresSmallestWidthDp=" + requiresSmallestWidthDp
4972762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn                + " compatibleWidthLimitDp=" + compatibleWidthLimitDp
4982762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn                + " largestWidthLimitDp=" + largestWidthLimitDp);
4999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        pw.println(prefix + "sourceDir=" + sourceDir);
500817c24752cf1d70bcd53a038a0d06abbb1ec6aadDianne Hackborn        if (sourceDir == null) {
501817c24752cf1d70bcd53a038a0d06abbb1ec6aadDianne Hackborn            if (publicSourceDir != null) {
502817c24752cf1d70bcd53a038a0d06abbb1ec6aadDianne Hackborn                pw.println(prefix + "publicSourceDir=" + publicSourceDir);
503817c24752cf1d70bcd53a038a0d06abbb1ec6aadDianne Hackborn            }
504817c24752cf1d70bcd53a038a0d06abbb1ec6aadDianne Hackborn        } else if (!sourceDir.equals(publicSourceDir)) {
50539792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn            pw.println(prefix + "publicSourceDir=" + publicSourceDir);
50639792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn        }
50739792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn        if (resourceDirs != null) {
50839792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn            pw.println(prefix + "resourceDirs=" + resourceDirs);
50939792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn        }
5100f40dc923c67e8822f9157aec4f786f73848af07Robert Craig        if (seinfo != null) {
5110f40dc923c67e8822f9157aec4f786f73848af07Robert Craig            pw.println(prefix + "seinfo=" + seinfo);
5120f40dc923c67e8822f9157aec4f786f73848af07Robert Craig        }
5139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        pw.println(prefix + "dataDir=" + dataDir);
51412527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        if (sharedLibraryFiles != null) {
51512527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn            pw.println(prefix + "sharedLibraryFiles=" + sharedLibraryFiles);
51612527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        }
51712527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        pw.println(prefix + "enabled=" + enabled + " targetSdkVersion=" + targetSdkVersion);
51812527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        if (manageSpaceActivityName != null) {
51912527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn            pw.println(prefix + "manageSpaceActivityName="+manageSpaceActivityName);
52012527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        }
52112527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        if (descriptionRes != 0) {
52212527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn            pw.println(prefix + "description=0x"+Integer.toHexString(descriptionRes));
52312527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn        }
524269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell        if (uiOptions != 0) {
525269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell            pw.println(prefix + "uiOptions=0x" + Integer.toHexString(uiOptions));
526269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell        }
52759dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio        pw.println(prefix + "supportsRtl=" + (hasRtlSupport() ? "true" : "false"));
5289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        super.dumpBack(pw, prefix);
5299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
53059dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio
53159dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio    /**
53259dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     * @return true if "supportsRtl" has been set to true in the AndroidManifest
53359dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     * @hide
53459dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio     */
53559dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio    public boolean hasRtlSupport() {
53659dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio        return (flags & FLAG_SUPPORTS_RTL) == FLAG_SUPPORTS_RTL;
53759dfce8bdaf011337530a0dbec7f7280871f9bc9Fabrice Di Meglio    }
5389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
5399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static class DisplayNameComparator
5409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            implements Comparator<ApplicationInfo> {
5419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        public DisplayNameComparator(PackageManager pm) {
5429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            mPM = pm;
5439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
5449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
5459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        public final int compare(ApplicationInfo aa, ApplicationInfo ab) {
5469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            CharSequence  sa = mPM.getApplicationLabel(aa);
5479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            if (sa == null) {
5489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project                sa = aa.packageName;
5499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            }
5509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            CharSequence  sb = mPM.getApplicationLabel(ab);
5519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            if (sb == null) {
5529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project                sb = ab.packageName;
5539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            }
5549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
5559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            return sCollator.compare(sa.toString(), sb.toString());
5569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
5579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
5589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        private final Collator   sCollator = Collator.getInstance();
5599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        private PackageManager   mPM;
5609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
5619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
5629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public ApplicationInfo() {
5639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
5649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
5659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public ApplicationInfo(ApplicationInfo orig) {
5669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        super(orig);
5679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        taskAffinity = orig.taskAffinity;
5689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        permission = orig.permission;
5699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        processName = orig.processName;
5709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        className = orig.className;
5719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        theme = orig.theme;
5729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        flags = orig.flags;
573df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn        requiresSmallestWidthDp = orig.requiresSmallestWidthDp;
574df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn        compatibleWidthLimitDp = orig.compatibleWidthLimitDp;
5752762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn        largestWidthLimitDp = orig.largestWidthLimitDp;
5769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        sourceDir = orig.sourceDir;
5779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        publicSourceDir = orig.publicSourceDir;
57885387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root        nativeLibraryDir = orig.nativeLibraryDir;
579d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root        resourceDirs = orig.resourceDirs;
5800f40dc923c67e8822f9157aec4f786f73848af07Robert Craig        seinfo = orig.seinfo;
5819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        sharedLibraryFiles = orig.sharedLibraryFiles;
5829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dataDir = orig.dataDir;
5839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        uid = orig.uid;
584a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn        targetSdkVersion = orig.targetSdkVersion;
5859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        enabled = orig.enabled;
5860ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn        enabledSetting = orig.enabledSetting;
58754e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn        installLocation = orig.installLocation;
5889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        manageSpaceActivityName = orig.manageSpaceActivityName;
5899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        descriptionRes = orig.descriptionRes;
590269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell        uiOptions = orig.uiOptions;
591bcb0255770caa6b053da100de13beb840da71b21Christopher Tate        backupAgentName = orig.backupAgentName;
5929066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
5939066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
5949066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
5959066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public String toString() {
5969066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        return "ApplicationInfo{"
5979066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            + Integer.toHexString(System.identityHashCode(this))
5989066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            + " " + packageName + "}";
5999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
6009066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
6019066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public int describeContents() {
6029066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        return 0;
6039066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
6049066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
6059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public void writeToParcel(Parcel dest, int parcelableFlags) {
6069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        super.writeToParcel(dest, parcelableFlags);
6079066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(taskAffinity);
6089066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(permission);
6099066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(processName);
6109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(className);
6119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(theme);
6129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(flags);
613df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn        dest.writeInt(requiresSmallestWidthDp);
614df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn        dest.writeInt(compatibleWidthLimitDp);
6152762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn        dest.writeInt(largestWidthLimitDp);
6169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(sourceDir);
6179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(publicSourceDir);
61885387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root        dest.writeString(nativeLibraryDir);
619d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root        dest.writeStringArray(resourceDirs);
6200f40dc923c67e8822f9157aec4f786f73848af07Robert Craig        dest.writeString(seinfo);
6219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeStringArray(sharedLibraryFiles);
6229066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(dataDir);
6239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(uid);
624a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn        dest.writeInt(targetSdkVersion);
6259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(enabled ? 1 : 0);
6260ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn        dest.writeInt(enabledSetting);
62754e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn        dest.writeInt(installLocation);
6289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeString(manageSpaceActivityName);
629181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate        dest.writeString(backupAgentName);
6309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dest.writeInt(descriptionRes);
631269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell        dest.writeInt(uiOptions);
6329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
6339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
6349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public static final Parcelable.Creator<ApplicationInfo> CREATOR
6359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            = new Parcelable.Creator<ApplicationInfo>() {
6369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        public ApplicationInfo createFromParcel(Parcel source) {
6379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            return new ApplicationInfo(source);
6389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
6399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        public ApplicationInfo[] newArray(int size) {
6409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            return new ApplicationInfo[size];
6419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
6429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    };
6439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
6449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    private ApplicationInfo(Parcel source) {
6459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        super(source);
6469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        taskAffinity = source.readString();
6479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        permission = source.readString();
6489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        processName = source.readString();
6499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        className = source.readString();
6509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        theme = source.readInt();
6519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        flags = source.readInt();
652df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn        requiresSmallestWidthDp = source.readInt();
653df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn        compatibleWidthLimitDp = source.readInt();
6542762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn        largestWidthLimitDp = source.readInt();
6559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        sourceDir = source.readString();
6569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        publicSourceDir = source.readString();
65785387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root        nativeLibraryDir = source.readString();
658d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root        resourceDirs = source.readStringArray();
6590f40dc923c67e8822f9157aec4f786f73848af07Robert Craig        seinfo = source.readString();
6609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        sharedLibraryFiles = source.readStringArray();
6619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        dataDir = source.readString();
6629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        uid = source.readInt();
663a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn        targetSdkVersion = source.readInt();
6649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        enabled = source.readInt() != 0;
6650ac3031c159a0904e73eb4439cdc724d8df4a6e6Dianne Hackborn        enabledSetting = source.readInt();
66654e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn        installLocation = source.readInt();
6679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        manageSpaceActivityName = source.readString();
668181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate        backupAgentName = source.readString();
6699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        descriptionRes = source.readInt();
670269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell        uiOptions = source.readInt();
6719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
6728d112675879a2b83197d3b4ae4fb623abd1a1ec3Mitsuru Oshima
6739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    /**
6749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * Retrieve the textual description of the application.  This
6759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * will call back on the given PackageManager to load the description from
6769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * the application.
6779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     *
6789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * @param pm A PackageManager from which the label can be loaded; usually
6799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * the PackageManager from which you originally retrieved this item.
6809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     *
6819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * @return Returns a CharSequence containing the application's description.
6829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     * If there is no description, null is returned.
6839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project     */
6849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    public CharSequence loadDescription(PackageManager pm) {
6859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        if (descriptionRes != 0) {
68607330791116513710d879c45b2f095cd314cbfd0Jeff Brown            CharSequence label = pm.getText(packageName, descriptionRes, this);
6879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            if (label != null) {
6889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project                return label;
6899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project            }
6909066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        }
6919066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project        return null;
6929066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project    }
693e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima
694e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima    /**
695e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima     * Disable compatibility mode
696e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima     *
697e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima     * @hide
698e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima     */
699e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima    public void disableCompatibilityMode() {
70069fff4a72d4dfc9208db79d773ef3ca23350287eMitsuru Oshima        flags |= (FLAG_SUPPORTS_LARGE_SCREENS | FLAG_SUPPORTS_NORMAL_SCREENS |
70111b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn                FLAG_SUPPORTS_SMALL_SCREENS | FLAG_RESIZEABLE_FOR_SCREENS |
70214cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn                FLAG_SUPPORTS_SCREEN_DENSITIES | FLAG_SUPPORTS_XLARGE_SCREENS);
703e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima    }
70407330791116513710d879c45b2f095cd314cbfd0Jeff Brown
70507330791116513710d879c45b2f095cd314cbfd0Jeff Brown    /**
70607330791116513710d879c45b2f095cd314cbfd0Jeff Brown     * @hide
70707330791116513710d879c45b2f095cd314cbfd0Jeff Brown     */
70807330791116513710d879c45b2f095cd314cbfd0Jeff Brown    @Override protected Drawable loadDefaultIcon(PackageManager pm) {
70907330791116513710d879c45b2f095cd314cbfd0Jeff Brown        if ((flags & FLAG_EXTERNAL_STORAGE) != 0
71007330791116513710d879c45b2f095cd314cbfd0Jeff Brown                && isPackageUnavailable(pm)) {
71107330791116513710d879c45b2f095cd314cbfd0Jeff Brown            return Resources.getSystem().getDrawable(
71207330791116513710d879c45b2f095cd314cbfd0Jeff Brown                    com.android.internal.R.drawable.sym_app_on_sd_unavailable_icon);
71307330791116513710d879c45b2f095cd314cbfd0Jeff Brown        }
71407330791116513710d879c45b2f095cd314cbfd0Jeff Brown        return pm.getDefaultActivityIcon();
71507330791116513710d879c45b2f095cd314cbfd0Jeff Brown    }
71607330791116513710d879c45b2f095cd314cbfd0Jeff Brown
71707330791116513710d879c45b2f095cd314cbfd0Jeff Brown    private boolean isPackageUnavailable(PackageManager pm) {
71807330791116513710d879c45b2f095cd314cbfd0Jeff Brown        try {
71907330791116513710d879c45b2f095cd314cbfd0Jeff Brown            return pm.getPackageInfo(packageName, 0) == null;
72007330791116513710d879c45b2f095cd314cbfd0Jeff Brown        } catch (NameNotFoundException ex) {
72107330791116513710d879c45b2f095cd314cbfd0Jeff Brown            return true;
72207330791116513710d879c45b2f095cd314cbfd0Jeff Brown        }
72307330791116513710d879c45b2f095cd314cbfd0Jeff Brown    }
72407330791116513710d879c45b2f095cd314cbfd0Jeff Brown
72507330791116513710d879c45b2f095cd314cbfd0Jeff Brown    /**
72607330791116513710d879c45b2f095cd314cbfd0Jeff Brown     * @hide
72707330791116513710d879c45b2f095cd314cbfd0Jeff Brown     */
72807330791116513710d879c45b2f095cd314cbfd0Jeff Brown    @Override protected ApplicationInfo getApplicationInfo() {
72907330791116513710d879c45b2f095cd314cbfd0Jeff Brown        return this;
73007330791116513710d879c45b2f095cd314cbfd0Jeff Brown    }
7319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project}
732