ApplicationInfo.java revision 2762ff3dc864018352362f6d103de471f9529ba6
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; 92181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate 93181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate /** 949066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Value for {@link #flags}: if set, this application is installed in the 959066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * device's system image. 969066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 979066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_SYSTEM = 1<<0; 989066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1009066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Value for {@link #flags}: set to true if this application would like to 1019066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * allow debugging of its 1029066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * code, even when installed on a non-development system. Comes 1039066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * from {@link android.R.styleable#AndroidManifestApplication_debuggable 1049066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * android:debuggable} of the <application> tag. 1059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_DEBUGGABLE = 1<<1; 1079066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 1089066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1099066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Value for {@link #flags}: set to true if this application has code 1109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * associated with it. Comes 1119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * from {@link android.R.styleable#AndroidManifestApplication_hasCode 1129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * android:hasCode} of the <application> tag. 1139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_HAS_CODE = 1<<2; 1159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 1169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Value for {@link #flags}: set to true if this application is persistent. 1189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Comes from {@link android.R.styleable#AndroidManifestApplication_persistent 1199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * android:persistent} of the <application> tag. 1209066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_PERSISTENT = 1<<3; 1229066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 1239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 124181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate * Value for {@link #flags}: set to true if this application holds the 1259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.Manifest.permission#FACTORY_TEST} permission and the 1269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * device is running in factory test mode. 1279066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_FACTORY_TEST = 1<<4; 1299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 1309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Value for {@link #flags}: default value for the corresponding ActivityInfo flag. 1329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Comes from {@link android.R.styleable#AndroidManifestApplication_allowTaskReparenting 1339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * android:allowTaskReparenting} of the <application> tag. 1349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_ALLOW_TASK_REPARENTING = 1<<5; 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_allowClearUserData 1409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * android:allowClearUserData} of the <application> tag. 1419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_ALLOW_CLEAR_USER_DATA = 1<<6; 1439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 1449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 145851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn * Value for {@link #flags}: this is set if this application has been 146851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn * install as an update to a built-in system application. 1479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_UPDATED_SYSTEM_APP = 1<<7; 149851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn 150851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn /** 1517f2054392e9957d3ba8579ef08c29cfb27df564eDianne Hackborn * Value for {@link #flags}: this is set of the application has specified 1527f2054392e9957d3ba8579ef08c29cfb27df564eDianne Hackborn * {@link android.R.styleable#AndroidManifestApplication_testOnly 1537f2054392e9957d3ba8579ef08c29cfb27df564eDianne Hackborn * android:testOnly} to be true. 154851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn */ 155a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn public static final int FLAG_TEST_ONLY = 1<<8; 156ade3ecad94d1f4431576f53bae26c35efbf7a2c9Dianne Hackborn 157ade3ecad94d1f4431576f53bae26c35efbf7a2c9Dianne Hackborn /** 1585c1e00b14d2ef10ec76abf3e951fa8003a67f558Dianne Hackborn * Value for {@link #flags}: true when the application's window can be 159723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * reduced in size for smaller screens. Corresponds to 160723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * {@link android.R.styleable#AndroidManifestSupportsScreens_smallScreens 161723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * android:smallScreens}. 1625c1e00b14d2ef10ec76abf3e951fa8003a67f558Dianne Hackborn */ 163723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn public static final int FLAG_SUPPORTS_SMALL_SCREENS = 1<<9; 164723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn 165723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn /** 166723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * Value for {@link #flags}: true when the application's window can be 167723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * displayed on normal screens. Corresponds to 168723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * {@link android.R.styleable#AndroidManifestSupportsScreens_normalScreens 169723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * android:normalScreens}. 170723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn */ 171723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn public static final int FLAG_SUPPORTS_NORMAL_SCREENS = 1<<10; 172723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn 173723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn /** 174723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * Value for {@link #flags}: true when the application's window can be 175723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * increased in size for larger screens. Corresponds to 176723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * {@link android.R.styleable#AndroidManifestSupportsScreens_largeScreens 17722ec9ab3b881d71866279ba9363c644a9e4e7164Dianne Hackborn * android:largeScreens}. 178723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn */ 179723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn public static final int FLAG_SUPPORTS_LARGE_SCREENS = 1<<11; 1805c1e00b14d2ef10ec76abf3e951fa8003a67f558Dianne Hackborn 1815c1e00b14d2ef10ec76abf3e951fa8003a67f558Dianne Hackborn /** 182c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn * Value for {@link #flags}: true when the application knows how to adjust 183c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn * its UI for different screen sizes. Corresponds to 184c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn * {@link android.R.styleable#AndroidManifestSupportsScreens_resizeable 185c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn * android:resizeable}. 186c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn */ 187c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn public static final int FLAG_RESIZEABLE_FOR_SCREENS = 1<<12; 188c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn 189c4db95c077f826585d20be2f3db4043c53d30cf5Dianne Hackborn /** 19011b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn * Value for {@link #flags}: true when the application knows how to 19111b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn * accomodate different screen densities. Corresponds to 19211b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn * {@link android.R.styleable#AndroidManifestSupportsScreens_anyDensity 19311b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn * android:anyDensity}. 19411b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn */ 19511b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn public static final int FLAG_SUPPORTS_SCREEN_DENSITIES = 1<<13; 19611b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn 19711b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn /** 19823085b781e145ed684e7270af1d5ced6800b8effBen Cheng * Value for {@link #flags}: set to true if this application would like to 19923085b781e145ed684e7270af1d5ced6800b8effBen Cheng * request the VM to operate under the safe mode. Comes from 200ef3f5ddc2137ed99e41f00441b688fb56b855179Ben Cheng * {@link android.R.styleable#AndroidManifestApplication_vmSafeMode 201ef3f5ddc2137ed99e41f00441b688fb56b855179Ben Cheng * android:vmSafeMode} of the <application> tag. 20223085b781e145ed684e7270af1d5ced6800b8effBen Cheng */ 20323085b781e145ed684e7270af1d5ced6800b8effBen Cheng public static final int FLAG_VM_SAFE_MODE = 1<<14; 20423085b781e145ed684e7270af1d5ced6800b8effBen Cheng 20523085b781e145ed684e7270af1d5ced6800b8effBen Cheng /** 2063de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * Value for {@link #flags}: set to <code>false</code> if the application does not wish 2073de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * to permit any OS-driven backups of its data; <code>true</code> otherwise. 208181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate * 2093de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * <p>Comes from the 2103de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup} 2113de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * attribute of the <application> tag. 212181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate */ 21323085b781e145ed684e7270af1d5ced6800b8effBen Cheng public static final int FLAG_ALLOW_BACKUP = 1<<15; 2145e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate 2155e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate /** 2163de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * Value for {@link #flags}: set to <code>false</code> if the application must be kept 2173de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * in memory following a full-system restore operation; <code>true</code> otherwise. 2183de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * Ordinarily, during a full system restore operation each application is shut down 2193de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * following execution of its agent's onRestore() method. Setting this attribute to 2203de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * <code>false</code> prevents this. Most applications will not need to set this attribute. 2215e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate * 2223de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * <p>If 2233de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup} 2243de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * is set to <code>false</code> or no 2253de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * {@link android.R.styleable#AndroidManifestApplication_backupAgent android:backupAgent} 2265e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate * is specified, this flag will be ignored. 2275e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate * 2283de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * <p>Comes from the 2293de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * {@link android.R.styleable#AndroidManifestApplication_killAfterRestore android:killAfterRestore} 2303de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * attribute of the <application> tag. 2315e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate */ 23223085b781e145ed684e7270af1d5ced6800b8effBen Cheng public static final int FLAG_KILL_AFTER_RESTORE = 1<<16; 2335e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate 2345e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate /** 2353de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * Value for {@link #flags}: Set to <code>true</code> if the application's backup 2363de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * agent claims to be able to handle restore data even "from the future," 2373de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * i.e. from versions of the application with a versionCode greater than 2383de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * the one currently installed on the device. <i>Use with caution!</i> By default 2393de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * this attribute is <code>false</code> and the Backup Manager will ensure that data 2403de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * from "future" versions of the application are never supplied during a restore operation. 2415e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate * 2423de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * <p>If 2433de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup} 2443de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * is set to <code>false</code> or no 2453de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * {@link android.R.styleable#AndroidManifestApplication_backupAgent android:backupAgent} 2465e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate * is specified, this flag will be ignored. 2475e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate * 2483de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * <p>Comes from the 2493de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * {@link android.R.styleable#AndroidManifestApplication_restoreAnyVersion android:restoreAnyVersion} 2503de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate * attribute of the <application> tag. 2515e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate */ 2523de55bcd34afd5871816526294f9514d1adf3fe5Christopher Tate public static final int FLAG_RESTORE_ANY_VERSION = 1<<17; 2535e1ab335e6e8fbfa19c64d53880a22f472010953Christopher Tate 254181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate /** 2553202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn * Value for {@link #flags}: Set to true if the application is 2563202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn * currently installed on external/removable/unprotected storage. Such 2573202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn * applications may not be available if their storage is not currently 2583202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn * mounted. When the storage it is on is not available, it will look like 2593202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn * the application has been uninstalled (its .apk is no longer available) 2603202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn * but its persistent data is not removed. 261af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu */ 26294c567e1e344d49168603f5a0560215a4ce735e6Dianne Hackborn public static final int FLAG_EXTERNAL_STORAGE = 1<<18; 263af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu 264af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu /** 26514cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn * Value for {@link #flags}: true when the application's window can be 26614cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn * increased in size for extra large screens. Corresponds to 26714cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn * {@link android.R.styleable#AndroidManifestSupportsScreens_xlargeScreens 26822ec9ab3b881d71866279ba9363c644a9e4e7164Dianne Hackborn * android:xlargeScreens}. 26914cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn */ 27014cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn public static final int FLAG_SUPPORTS_XLARGE_SCREENS = 1<<19; 27114cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn 27214cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn /** 2733b81bc18bb661c02ad8074c39dab16644c1e65d0Dianne Hackborn * Value for {@link #flags}: true when the application has requested a 2743b81bc18bb661c02ad8074c39dab16644c1e65d0Dianne Hackborn * large heap for its processes. Corresponds to 2753b81bc18bb661c02ad8074c39dab16644c1e65d0Dianne Hackborn * {@link android.R.styleable#AndroidManifestApplication_largeHeap 2763b81bc18bb661c02ad8074c39dab16644c1e65d0Dianne Hackborn * android:largeHeap}. 277a3cdaa5337fa573c4c61770195d6232c2e587090Jason parks */ 2783b81bc18bb661c02ad8074c39dab16644c1e65d0Dianne Hackborn public static final int FLAG_LARGE_HEAP = 1<<20; 279a3cdaa5337fa573c4c61770195d6232c2e587090Jason parks 280a3cdaa5337fa573c4c61770195d6232c2e587090Jason parks /** 281e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn * Value for {@link #flags}: true if this application's package is in 282e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn * the stopped state. 283e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn */ 284e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn public static final int FLAG_STOPPED = 1<<21; 285e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn 286e7f972122db87dc54e41ed1a6e417534d43bca3aDianne Hackborn /** 2873202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn * Value for {@link #flags}: Set to true if the application has been 2883202d380226043fa665df3c92252f791f8c52d55Dianne Hackborn * installed using the forward lock option. 289af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu * 29075e616e8203a540c860888ccff73ffaa87498c5eDianne Hackborn * NOTE: DO NOT CHANGE THIS VALUE! It is saved in packages.xml. 29175e616e8203a540c860888ccff73ffaa87498c5eDianne Hackborn * 292af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu * {@hide} 293af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu */ 29475e616e8203a540c860888ccff73ffaa87498c5eDianne Hackborn public static final int FLAG_FORWARD_LOCK = 1<<29; 295af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu 296af8e9f4805643f90a9dc0ecfa119e0a860c12f8aSuchi Amalapurapu /** 29702486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn * Value for {@link #flags}: set to <code>true</code> if the application 29802486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn * has reported that it is heavy-weight, and thus can not participate in 29902486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn * the normal application lifecycle. 30002486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn * 30102486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn * <p>Comes from the 30254e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn * {@link android.R.styleable#AndroidManifestApplication_cantSaveState android:cantSaveState} 30302486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn * attribute of the <application> tag. 30402486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn * 30502486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn * {@hide} 30602486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn */ 30775e616e8203a540c860888ccff73ffaa87498c5eDianne Hackborn public static final int FLAG_CANT_SAVE_STATE = 1<<28; 30802486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn 30902486b1327e3007c62d253dd89ba9db1852b87f8Dianne Hackborn /** 3109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Flags associated with the application. Any combination of 3119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE}, 3129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #FLAG_PERSISTENT}, {@link #FLAG_FACTORY_TEST}, and 3139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #FLAG_ALLOW_TASK_REPARENTING} 314851a54143c15a1c33361efae2db3f7f45059b472Dianne Hackborn * {@link #FLAG_ALLOW_CLEAR_USER_DATA}, {@link #FLAG_UPDATED_SYSTEM_APP}, 315723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * {@link #FLAG_TEST_ONLY}, {@link #FLAG_SUPPORTS_SMALL_SCREENS}, 316723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * {@link #FLAG_SUPPORTS_NORMAL_SCREENS}, 31714cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn * {@link #FLAG_SUPPORTS_LARGE_SCREENS}, {@link #FLAG_SUPPORTS_XLARGE_SCREENS}, 31814cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn * {@link #FLAG_RESIZEABLE_FOR_SCREENS}, 31923085b781e145ed684e7270af1d5ced6800b8effBen Cheng * {@link #FLAG_SUPPORTS_SCREEN_DENSITIES}, {@link #FLAG_VM_SAFE_MODE} 3209066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int flags = 0; 3229066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 3239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 324df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn * The required smallest screen width the application can run on. If 0, 325df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn * nothing has been specified. Comes from 326df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn * {@link android.R.styleable#AndroidManifestSupportsScreens_requiresSmallestWidthDp 327df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn * android:requiresSmallestWidthDp} attribute of the <supports-screens> tag. 328df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn */ 329df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn public int requiresSmallestWidthDp = 0; 330df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn 331df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn /** 332df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn * The maximum smallest screen width the application is designed for. If 0, 333df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn * nothing has been specified. Comes from 334df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn * {@link android.R.styleable#AndroidManifestSupportsScreens_compatibleWidthLimitDp 335df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn * android:compatibleWidthLimitDp} attribute of the <supports-screens> tag. 336df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn */ 337df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn public int compatibleWidthLimitDp = 0; 338df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn 339df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn /** 3402762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn * The maximum smallest screen width the application will work on. If 0, 3412762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn * nothing has been specified. Comes from 3422762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn * {@link android.R.styleable#AndroidManifestSupportsScreens_largestWidthLimitDp 3432762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn * android:largestWidthLimitDp} attribute of the <supports-screens> tag. 3442762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn */ 3452762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn public int largestWidthLimitDp = 0; 3462762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn 3472762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn /** 3489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Full path to the location of this package. 3499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public String sourceDir; 3519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 3529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 353d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root * Full path to the location of the publicly available parts of this 354d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root * package (i.e. the primary resource package and manifest). For 355d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root * non-forward-locked apps this will be the same as {@link #sourceDir). 3569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public String publicSourceDir; 3589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 3599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 360d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root * Full paths to the locations of extra resource packages this application 361d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root * uses. This field is only used if there are extra resource packages, 362d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root * otherwise it is null. 363ace5a3fbfbf1b41905410925f1ea007040a7a675Kenny Root * 364ace5a3fbfbf1b41905410925f1ea007040a7a675Kenny Root * {@hide} 365d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root */ 366d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root public String[] resourceDirs; 367d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root 368d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root /** 3699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Paths to all shared libraries this application is linked against. This 3709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * field is only set if the {@link PackageManager#GET_SHARED_LIBRARY_FILES 3719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * PackageManager.GET_SHARED_LIBRARY_FILES} flag was used when retrieving 3729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the structure. 3739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public String[] sharedLibraryFiles; 3759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 3769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 3779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Full path to a directory assigned to the package for its persistent 3789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * data. 3799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public String dataDir; 38185387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root 38285387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root /** 38385387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root * Full path to the directory where native JNI libraries are stored. 38485387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root */ 38585387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root public String nativeLibraryDir; 38685387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root 3879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 3889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * The kernel user-ID that has been assigned to this application; 3899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * currently this is not a unique ID (multiple applications can have 3909066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the same uid). 3919066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3929066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int uid; 3939066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 3948d112675879a2b83197d3b4ae4fb623abd1a1ec3Mitsuru Oshima /** 3953b3e145d3c41fd68974e08f799b1fd1f8f060cf0Dianne Hackborn * The minimum SDK version this application targets. It may run on earlier 396a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn * versions, but it knows how to work with any new behavior added at this 397a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn * version. Will be {@link android.os.Build.VERSION_CODES#CUR_DEVELOPMENT} 398a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn * if this is a development build and the app is targeting that. You should 399a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn * compare that this number is >= the SDK version number at which your 400a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn * behavior was introduced. 401a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn */ 402a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn public int targetSdkVersion; 403a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn 404a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn /** 4059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * When false, indicates that all components within this application are 4069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * considered disabled, regardless of their individually set enabled status. 4079066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 4089066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public boolean enabled = true; 4099066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 41054e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn /** 41154e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn * For convenient access to package's install location. 41254e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn * @hide 41354e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn */ 41454e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn public int installLocation = PackageInfo.INSTALL_LOCATION_UNSPECIFIED; 41554e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn 4169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void dump(Printer pw, String prefix) { 4179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project super.dumpFront(pw, prefix); 41812527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn if (className != null) { 41912527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn pw.println(prefix + "className=" + className); 42012527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn } 42112527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn if (permission != null) { 42212527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn pw.println(prefix + "permission=" + permission); 42312527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn } 42439792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn pw.println(prefix + "processName=" + processName); 42539792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn pw.println(prefix + "taskAffinity=" + taskAffinity); 42639792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags) 42739792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn + " theme=0x" + Integer.toHexString(theme)); 428df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn pw.println(prefix + "requiresSmallestWidthDp=" + requiresSmallestWidthDp 4292762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn + " compatibleWidthLimitDp=" + compatibleWidthLimitDp 4302762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn + " largestWidthLimitDp=" + largestWidthLimitDp); 4319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project pw.println(prefix + "sourceDir=" + sourceDir); 432817c24752cf1d70bcd53a038a0d06abbb1ec6aadDianne Hackborn if (sourceDir == null) { 433817c24752cf1d70bcd53a038a0d06abbb1ec6aadDianne Hackborn if (publicSourceDir != null) { 434817c24752cf1d70bcd53a038a0d06abbb1ec6aadDianne Hackborn pw.println(prefix + "publicSourceDir=" + publicSourceDir); 435817c24752cf1d70bcd53a038a0d06abbb1ec6aadDianne Hackborn } 436817c24752cf1d70bcd53a038a0d06abbb1ec6aadDianne Hackborn } else if (!sourceDir.equals(publicSourceDir)) { 43739792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn pw.println(prefix + "publicSourceDir=" + publicSourceDir); 43839792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn } 43939792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn if (resourceDirs != null) { 44039792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn pw.println(prefix + "resourceDirs=" + resourceDirs); 44139792d2262352ae775091876d5488d2412a2ff92Dianne Hackborn } 4429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project pw.println(prefix + "dataDir=" + dataDir); 44312527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn if (sharedLibraryFiles != null) { 44412527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn pw.println(prefix + "sharedLibraryFiles=" + sharedLibraryFiles); 44512527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn } 44612527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn pw.println(prefix + "enabled=" + enabled + " targetSdkVersion=" + targetSdkVersion); 44712527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn if (manageSpaceActivityName != null) { 44812527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn pw.println(prefix + "manageSpaceActivityName="+manageSpaceActivityName); 44912527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn } 45012527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn if (descriptionRes != 0) { 45112527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn pw.println(prefix + "description=0x"+Integer.toHexString(descriptionRes)); 45212527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn } 4539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project super.dumpBack(pw, prefix); 4549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 4559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 4569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static class DisplayNameComparator 4579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project implements Comparator<ApplicationInfo> { 4589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public DisplayNameComparator(PackageManager pm) { 4599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project mPM = pm; 4609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 4619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 4629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public final int compare(ApplicationInfo aa, ApplicationInfo ab) { 4639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project CharSequence sa = mPM.getApplicationLabel(aa); 4649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project if (sa == null) { 4659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project sa = aa.packageName; 4669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 4679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project CharSequence sb = mPM.getApplicationLabel(ab); 4689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project if (sb == null) { 4699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project sb = ab.packageName; 4709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 4719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 4729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project return sCollator.compare(sa.toString(), sb.toString()); 4739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 4749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 4759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project private final Collator sCollator = Collator.getInstance(); 4769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project private PackageManager mPM; 4779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 4789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 4799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public ApplicationInfo() { 4809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 4819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 4829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public ApplicationInfo(ApplicationInfo orig) { 4839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project super(orig); 4849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project taskAffinity = orig.taskAffinity; 4859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project permission = orig.permission; 4869066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project processName = orig.processName; 4879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project className = orig.className; 4889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project theme = orig.theme; 4899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project flags = orig.flags; 490df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn requiresSmallestWidthDp = orig.requiresSmallestWidthDp; 491df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn compatibleWidthLimitDp = orig.compatibleWidthLimitDp; 4922762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn largestWidthLimitDp = orig.largestWidthLimitDp; 4939066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project sourceDir = orig.sourceDir; 4949066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project publicSourceDir = orig.publicSourceDir; 49585387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root nativeLibraryDir = orig.nativeLibraryDir; 496d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root resourceDirs = orig.resourceDirs; 4979066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project sharedLibraryFiles = orig.sharedLibraryFiles; 4989066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dataDir = orig.dataDir; 4999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project uid = orig.uid; 500a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn targetSdkVersion = orig.targetSdkVersion; 5019066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project enabled = orig.enabled; 50254e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn installLocation = orig.installLocation; 5039066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project manageSpaceActivityName = orig.manageSpaceActivityName; 5049066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project descriptionRes = orig.descriptionRes; 5059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 5069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 5079066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 5089066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public String toString() { 5099066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project return "ApplicationInfo{" 5109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project + Integer.toHexString(System.identityHashCode(this)) 5119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project + " " + packageName + "}"; 5129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 5139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 5149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int describeContents() { 5159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project return 0; 5169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 5179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 5189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void writeToParcel(Parcel dest, int parcelableFlags) { 5199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project super.writeToParcel(dest, parcelableFlags); 5209066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeString(taskAffinity); 5219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeString(permission); 5229066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeString(processName); 5239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeString(className); 5249066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(theme); 5259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(flags); 526df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn dest.writeInt(requiresSmallestWidthDp); 527df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn dest.writeInt(compatibleWidthLimitDp); 5282762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn dest.writeInt(largestWidthLimitDp); 5299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeString(sourceDir); 5309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeString(publicSourceDir); 53185387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root dest.writeString(nativeLibraryDir); 532d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root dest.writeStringArray(resourceDirs); 5339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeStringArray(sharedLibraryFiles); 5349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeString(dataDir); 5359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(uid); 536a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn dest.writeInt(targetSdkVersion); 5379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(enabled ? 1 : 0); 53854e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn dest.writeInt(installLocation); 5399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeString(manageSpaceActivityName); 540181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate dest.writeString(backupAgentName); 5419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(descriptionRes); 5429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 5439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 5449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final Parcelable.Creator<ApplicationInfo> CREATOR 5459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project = new Parcelable.Creator<ApplicationInfo>() { 5469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public ApplicationInfo createFromParcel(Parcel source) { 5479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project return new ApplicationInfo(source); 5489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 5499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public ApplicationInfo[] newArray(int size) { 5509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project return new ApplicationInfo[size]; 5519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 5529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project }; 5539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 5549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project private ApplicationInfo(Parcel source) { 5559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project super(source); 5569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project taskAffinity = source.readString(); 5579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project permission = source.readString(); 5589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project processName = source.readString(); 5599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project className = source.readString(); 5609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project theme = source.readInt(); 5619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project flags = source.readInt(); 562df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn requiresSmallestWidthDp = source.readInt(); 563df6e980e3f63eb0f6f9eb437fa925d5009cd9c44Dianne Hackborn compatibleWidthLimitDp = source.readInt(); 5642762ff3dc864018352362f6d103de471f9529ba6Dianne Hackborn largestWidthLimitDp = source.readInt(); 5659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project sourceDir = source.readString(); 5669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project publicSourceDir = source.readString(); 56785387d7ba36e56b291cbde87acb5a5b2200fe01cKenny Root nativeLibraryDir = source.readString(); 568d1ab01682b136b586aac94334f976f03c762b3c7Kenny Root resourceDirs = source.readStringArray(); 5699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project sharedLibraryFiles = source.readStringArray(); 5709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dataDir = source.readString(); 5719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project uid = source.readInt(); 572a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3dDianne Hackborn targetSdkVersion = source.readInt(); 5739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project enabled = source.readInt() != 0; 57454e570f78b45d6c47578a4a2513097b590b6d43fDianne Hackborn installLocation = source.readInt(); 5759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project manageSpaceActivityName = source.readString(); 576181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate backupAgentName = source.readString(); 5779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project descriptionRes = source.readInt(); 5789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 5798d112675879a2b83197d3b4ae4fb623abd1a1ec3Mitsuru Oshima 5809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 5819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Retrieve the textual description of the application. This 5829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * will call back on the given PackageManager to load the description from 5839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the application. 5849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 5859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @param pm A PackageManager from which the label can be loaded; usually 5869066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the PackageManager from which you originally retrieved this item. 5879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 5889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @return Returns a CharSequence containing the application's description. 5899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * If there is no description, null is returned. 5909066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 5919066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public CharSequence loadDescription(PackageManager pm) { 5929066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project if (descriptionRes != 0) { 59307330791116513710d879c45b2f095cd314cbfd0Jeff Brown CharSequence label = pm.getText(packageName, descriptionRes, this); 5949066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project if (label != null) { 5959066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project return label; 5969066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 5979066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 5989066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project return null; 5999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 600e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima 601e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima /** 602e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima * Disable compatibility mode 603e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima * 604e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima * @hide 605e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima */ 606e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima public void disableCompatibilityMode() { 60769fff4a72d4dfc9208db79d773ef3ca23350287eMitsuru Oshima flags |= (FLAG_SUPPORTS_LARGE_SCREENS | FLAG_SUPPORTS_NORMAL_SCREENS | 60811b822d2a91ea17c34c0cb1c11e80a9a30d72864Dianne Hackborn FLAG_SUPPORTS_SMALL_SCREENS | FLAG_RESIZEABLE_FOR_SCREENS | 60914cee9f688c32d63d8521188e7422811629bb7c2Dianne Hackborn FLAG_SUPPORTS_SCREEN_DENSITIES | FLAG_SUPPORTS_XLARGE_SCREENS); 610e5fb328825995aa33b5b7ecf8b5bee2b17f81715Mitsuru Oshima } 61107330791116513710d879c45b2f095cd314cbfd0Jeff Brown 61207330791116513710d879c45b2f095cd314cbfd0Jeff Brown /** 61307330791116513710d879c45b2f095cd314cbfd0Jeff Brown * @hide 61407330791116513710d879c45b2f095cd314cbfd0Jeff Brown */ 61507330791116513710d879c45b2f095cd314cbfd0Jeff Brown @Override protected Drawable loadDefaultIcon(PackageManager pm) { 61607330791116513710d879c45b2f095cd314cbfd0Jeff Brown if ((flags & FLAG_EXTERNAL_STORAGE) != 0 61707330791116513710d879c45b2f095cd314cbfd0Jeff Brown && isPackageUnavailable(pm)) { 61807330791116513710d879c45b2f095cd314cbfd0Jeff Brown return Resources.getSystem().getDrawable( 61907330791116513710d879c45b2f095cd314cbfd0Jeff Brown com.android.internal.R.drawable.sym_app_on_sd_unavailable_icon); 62007330791116513710d879c45b2f095cd314cbfd0Jeff Brown } 62107330791116513710d879c45b2f095cd314cbfd0Jeff Brown return pm.getDefaultActivityIcon(); 62207330791116513710d879c45b2f095cd314cbfd0Jeff Brown } 62307330791116513710d879c45b2f095cd314cbfd0Jeff Brown 62407330791116513710d879c45b2f095cd314cbfd0Jeff Brown private boolean isPackageUnavailable(PackageManager pm) { 62507330791116513710d879c45b2f095cd314cbfd0Jeff Brown try { 62607330791116513710d879c45b2f095cd314cbfd0Jeff Brown return pm.getPackageInfo(packageName, 0) == null; 62707330791116513710d879c45b2f095cd314cbfd0Jeff Brown } catch (NameNotFoundException ex) { 62807330791116513710d879c45b2f095cd314cbfd0Jeff Brown return true; 62907330791116513710d879c45b2f095cd314cbfd0Jeff Brown } 63007330791116513710d879c45b2f095cd314cbfd0Jeff Brown } 63107330791116513710d879c45b2f095cd314cbfd0Jeff Brown 63207330791116513710d879c45b2f095cd314cbfd0Jeff Brown /** 63307330791116513710d879c45b2f095cd314cbfd0Jeff Brown * @hide 63407330791116513710d879c45b2f095cd314cbfd0Jeff Brown */ 63507330791116513710d879c45b2f095cd314cbfd0Jeff Brown @Override protected ApplicationInfo getApplicationInfo() { 63607330791116513710d879c45b2f095cd314cbfd0Jeff Brown return this; 63707330791116513710d879c45b2f095cd314cbfd0Jeff Brown } 6389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project} 639