Kenny Root | 15a4d2f | 2010-03-11 18:20:12 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 17 | package android.content.pm; |
| 18 | |
Jeff Brown | 0733079 | 2010-03-30 19:57:08 -0700 | [diff] [blame] | 19 | import android.content.pm.PackageManager.NameNotFoundException; |
| 20 | import android.content.res.Resources; |
| 21 | import android.graphics.drawable.Drawable; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | import android.os.Parcel; |
| 23 | import android.os.Parcelable; |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 24 | import android.text.TextUtils; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | import android.util.Printer; |
| 26 | |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 27 | import com.android.internal.util.ArrayUtils; |
| 28 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 29 | import java.text.Collator; |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 30 | import java.util.Arrays; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | import java.util.Comparator; |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 32 | import java.util.Objects; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 33 | |
| 34 | /** |
| 35 | * Information you can retrieve about a particular application. This |
| 36 | * corresponds to information collected from the AndroidManifest.xml's |
| 37 | * <application> tag. |
| 38 | */ |
| 39 | public class ApplicationInfo extends PackageItemInfo implements Parcelable { |
| 40 | |
| 41 | /** |
| 42 | * Default task affinity of all activities in this application. See |
| 43 | * {@link ActivityInfo#taskAffinity} for more information. This comes |
| 44 | * from the "taskAffinity" attribute. |
| 45 | */ |
| 46 | public String taskAffinity; |
| 47 | |
| 48 | /** |
| 49 | * Optional name of a permission required to be able to access this |
| 50 | * application's components. From the "permission" attribute. |
| 51 | */ |
| 52 | public String permission; |
| 53 | |
| 54 | /** |
| 55 | * The name of the process this application should run in. From the |
| 56 | * "process" attribute or, if not set, the same as |
| 57 | * <var>packageName</var>. |
| 58 | */ |
| 59 | public String processName; |
| 60 | |
| 61 | /** |
| 62 | * Class implementing the Application object. From the "class" |
| 63 | * attribute. |
| 64 | */ |
| 65 | public String className; |
| 66 | |
| 67 | /** |
| 68 | * A style resource identifier (in the package's resources) of the |
| 69 | * description of an application. From the "description" attribute |
| 70 | * or, if not set, 0. |
| 71 | */ |
| 72 | public int descriptionRes; |
| 73 | |
| 74 | /** |
| 75 | * A style resource identifier (in the package's resources) of the |
| 76 | * default visual theme of the application. From the "theme" attribute |
| 77 | * or, if not set, 0. |
| 78 | */ |
| 79 | public int theme; |
| 80 | |
| 81 | /** |
| 82 | * Class implementing the Application's manage space |
| 83 | * functionality. From the "manageSpaceActivity" |
| 84 | * attribute. This is an optional attribute and will be null if |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 85 | * applications don't specify it in their manifest |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 86 | */ |
| 87 | public String manageSpaceActivityName; |
| 88 | |
| 89 | /** |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 90 | * Class implementing the Application's backup functionality. From |
| 91 | * the "backupAgent" attribute. This is an optional attribute and |
| 92 | * will be null if the application does not specify it in its manifest. |
| 93 | * |
| 94 | * <p>If android:allowBackup is set to false, this attribute is ignored. |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 95 | */ |
| 96 | public String backupAgentName; |
Christopher Tate | 4a627c7 | 2011-04-01 14:43:32 -0700 | [diff] [blame] | 97 | |
| 98 | /** |
Matthew Williams | 303650c | 2015-04-17 18:22:51 -0700 | [diff] [blame] | 99 | * An optional attribute that indicates the app supports automatic backup of app data. |
| 100 | * <p>0 is the default and means the app's entire data folder + managed external storage will |
| 101 | * be backed up; |
| 102 | * Any negative value indicates the app does not support full-data backup, though it may still |
| 103 | * want to participate via the traditional key/value backup API; |
| 104 | * A positive number specifies an xml resource in which the application has defined its backup |
| 105 | * include/exclude criteria. |
| 106 | * <p>If android:allowBackup is set to false, this attribute is ignored. |
| 107 | * |
| 108 | * @see {@link android.content.Context#getNoBackupFilesDir} |
| 109 | * @see {@link #FLAG_ALLOW_BACKUP} |
Christopher Tate | 98fa656 | 2015-05-14 13:20:10 -0700 | [diff] [blame^] | 110 | * |
| 111 | * @hide |
Matthew Williams | 303650c | 2015-04-17 18:22:51 -0700 | [diff] [blame] | 112 | */ |
| 113 | public int fullBackupContent = 0; |
| 114 | |
| 115 | /** |
Adam Powell | 269248d | 2011-08-02 10:26:54 -0700 | [diff] [blame] | 116 | * The default extra UI options for activities in this application. |
| 117 | * Set from the {@link android.R.attr#uiOptions} attribute in the |
| 118 | * activity's manifest. |
| 119 | */ |
| 120 | public int uiOptions = 0; |
| 121 | |
| 122 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 123 | * Value for {@link #flags}: if set, this application is installed in the |
| 124 | * device's system image. |
| 125 | */ |
| 126 | public static final int FLAG_SYSTEM = 1<<0; |
| 127 | |
| 128 | /** |
| 129 | * Value for {@link #flags}: set to true if this application would like to |
| 130 | * allow debugging of its |
| 131 | * code, even when installed on a non-development system. Comes |
| 132 | * from {@link android.R.styleable#AndroidManifestApplication_debuggable |
| 133 | * android:debuggable} of the <application> tag. |
| 134 | */ |
| 135 | public static final int FLAG_DEBUGGABLE = 1<<1; |
| 136 | |
| 137 | /** |
| 138 | * Value for {@link #flags}: set to true if this application has code |
| 139 | * associated with it. Comes |
| 140 | * from {@link android.R.styleable#AndroidManifestApplication_hasCode |
| 141 | * android:hasCode} of the <application> tag. |
| 142 | */ |
| 143 | public static final int FLAG_HAS_CODE = 1<<2; |
| 144 | |
| 145 | /** |
| 146 | * Value for {@link #flags}: set to true if this application is persistent. |
| 147 | * Comes from {@link android.R.styleable#AndroidManifestApplication_persistent |
| 148 | * android:persistent} of the <application> tag. |
| 149 | */ |
| 150 | public static final int FLAG_PERSISTENT = 1<<3; |
| 151 | |
| 152 | /** |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 153 | * Value for {@link #flags}: set to true if this application holds the |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 154 | * {@link android.Manifest.permission#FACTORY_TEST} permission and the |
| 155 | * device is running in factory test mode. |
| 156 | */ |
| 157 | public static final int FLAG_FACTORY_TEST = 1<<4; |
| 158 | |
| 159 | /** |
| 160 | * Value for {@link #flags}: default value for the corresponding ActivityInfo flag. |
| 161 | * Comes from {@link android.R.styleable#AndroidManifestApplication_allowTaskReparenting |
| 162 | * android:allowTaskReparenting} of the <application> tag. |
| 163 | */ |
| 164 | public static final int FLAG_ALLOW_TASK_REPARENTING = 1<<5; |
| 165 | |
| 166 | /** |
| 167 | * Value for {@link #flags}: default value for the corresponding ActivityInfo flag. |
| 168 | * Comes from {@link android.R.styleable#AndroidManifestApplication_allowClearUserData |
| 169 | * android:allowClearUserData} of the <application> tag. |
| 170 | */ |
| 171 | public static final int FLAG_ALLOW_CLEAR_USER_DATA = 1<<6; |
| 172 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 173 | /** |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 174 | * Value for {@link #flags}: this is set if this application has been |
| 175 | * install as an update to a built-in system application. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 176 | */ |
| 177 | public static final int FLAG_UPDATED_SYSTEM_APP = 1<<7; |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 178 | |
| 179 | /** |
Dianne Hackborn | 7f20543 | 2009-07-28 00:13:47 -0700 | [diff] [blame] | 180 | * Value for {@link #flags}: this is set of the application has specified |
| 181 | * {@link android.R.styleable#AndroidManifestApplication_testOnly |
| 182 | * android:testOnly} to be true. |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 183 | */ |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 184 | public static final int FLAG_TEST_ONLY = 1<<8; |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 185 | |
| 186 | /** |
Dianne Hackborn | 5c1e00b | 2009-06-18 17:10:57 -0700 | [diff] [blame] | 187 | * Value for {@link #flags}: true when the application's window can be |
Dianne Hackborn | 723738c | 2009-06-25 19:48:04 -0700 | [diff] [blame] | 188 | * reduced in size for smaller screens. Corresponds to |
| 189 | * {@link android.R.styleable#AndroidManifestSupportsScreens_smallScreens |
| 190 | * android:smallScreens}. |
Dianne Hackborn | 5c1e00b | 2009-06-18 17:10:57 -0700 | [diff] [blame] | 191 | */ |
Dianne Hackborn | 723738c | 2009-06-25 19:48:04 -0700 | [diff] [blame] | 192 | public static final int FLAG_SUPPORTS_SMALL_SCREENS = 1<<9; |
| 193 | |
| 194 | /** |
| 195 | * Value for {@link #flags}: true when the application's window can be |
| 196 | * displayed on normal screens. Corresponds to |
| 197 | * {@link android.R.styleable#AndroidManifestSupportsScreens_normalScreens |
| 198 | * android:normalScreens}. |
| 199 | */ |
| 200 | public static final int FLAG_SUPPORTS_NORMAL_SCREENS = 1<<10; |
| 201 | |
| 202 | /** |
| 203 | * Value for {@link #flags}: true when the application's window can be |
| 204 | * increased in size for larger screens. Corresponds to |
| 205 | * {@link android.R.styleable#AndroidManifestSupportsScreens_largeScreens |
Dianne Hackborn | 22ec9ab | 2010-04-29 17:56:03 -0700 | [diff] [blame] | 206 | * android:largeScreens}. |
Dianne Hackborn | 723738c | 2009-06-25 19:48:04 -0700 | [diff] [blame] | 207 | */ |
| 208 | public static final int FLAG_SUPPORTS_LARGE_SCREENS = 1<<11; |
Dianne Hackborn | 5c1e00b | 2009-06-18 17:10:57 -0700 | [diff] [blame] | 209 | |
| 210 | /** |
Dianne Hackborn | c4db95c | 2009-07-21 17:46:02 -0700 | [diff] [blame] | 211 | * Value for {@link #flags}: true when the application knows how to adjust |
| 212 | * its UI for different screen sizes. Corresponds to |
| 213 | * {@link android.R.styleable#AndroidManifestSupportsScreens_resizeable |
| 214 | * android:resizeable}. |
| 215 | */ |
| 216 | public static final int FLAG_RESIZEABLE_FOR_SCREENS = 1<<12; |
| 217 | |
| 218 | /** |
Dianne Hackborn | 11b822d | 2009-07-21 20:03:02 -0700 | [diff] [blame] | 219 | * Value for {@link #flags}: true when the application knows how to |
| 220 | * accomodate different screen densities. Corresponds to |
| 221 | * {@link android.R.styleable#AndroidManifestSupportsScreens_anyDensity |
| 222 | * android:anyDensity}. |
| 223 | */ |
| 224 | public static final int FLAG_SUPPORTS_SCREEN_DENSITIES = 1<<13; |
| 225 | |
| 226 | /** |
Ben Cheng | 23085b7 | 2010-02-08 16:06:32 -0800 | [diff] [blame] | 227 | * Value for {@link #flags}: set to true if this application would like to |
| 228 | * request the VM to operate under the safe mode. Comes from |
Ben Cheng | ef3f5dd | 2010-03-29 15:47:26 -0700 | [diff] [blame] | 229 | * {@link android.R.styleable#AndroidManifestApplication_vmSafeMode |
| 230 | * android:vmSafeMode} of the <application> tag. |
Ben Cheng | 23085b7 | 2010-02-08 16:06:32 -0800 | [diff] [blame] | 231 | */ |
| 232 | public static final int FLAG_VM_SAFE_MODE = 1<<14; |
| 233 | |
| 234 | /** |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 235 | * Value for {@link #flags}: set to <code>false</code> if the application does not wish |
| 236 | * to permit any OS-driven backups of its data; <code>true</code> otherwise. |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 237 | * |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 238 | * <p>Comes from the |
| 239 | * {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup} |
| 240 | * attribute of the <application> tag. |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 241 | */ |
Ben Cheng | 23085b7 | 2010-02-08 16:06:32 -0800 | [diff] [blame] | 242 | public static final int FLAG_ALLOW_BACKUP = 1<<15; |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 243 | |
| 244 | /** |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 245 | * Value for {@link #flags}: set to <code>false</code> if the application must be kept |
| 246 | * in memory following a full-system restore operation; <code>true</code> otherwise. |
| 247 | * Ordinarily, during a full system restore operation each application is shut down |
| 248 | * following execution of its agent's onRestore() method. Setting this attribute to |
| 249 | * <code>false</code> prevents this. Most applications will not need to set this attribute. |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 250 | * |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 251 | * <p>If |
| 252 | * {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup} |
| 253 | * is set to <code>false</code> or no |
| 254 | * {@link android.R.styleable#AndroidManifestApplication_backupAgent android:backupAgent} |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 255 | * is specified, this flag will be ignored. |
| 256 | * |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 257 | * <p>Comes from the |
| 258 | * {@link android.R.styleable#AndroidManifestApplication_killAfterRestore android:killAfterRestore} |
| 259 | * attribute of the <application> tag. |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 260 | */ |
Ben Cheng | 23085b7 | 2010-02-08 16:06:32 -0800 | [diff] [blame] | 261 | public static final int FLAG_KILL_AFTER_RESTORE = 1<<16; |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 262 | |
| 263 | /** |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 264 | * Value for {@link #flags}: Set to <code>true</code> if the application's backup |
| 265 | * agent claims to be able to handle restore data even "from the future," |
| 266 | * i.e. from versions of the application with a versionCode greater than |
| 267 | * the one currently installed on the device. <i>Use with caution!</i> By default |
| 268 | * this attribute is <code>false</code> and the Backup Manager will ensure that data |
| 269 | * from "future" versions of the application are never supplied during a restore operation. |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 270 | * |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 271 | * <p>If |
| 272 | * {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup} |
| 273 | * is set to <code>false</code> or no |
| 274 | * {@link android.R.styleable#AndroidManifestApplication_backupAgent android:backupAgent} |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 275 | * is specified, this flag will be ignored. |
| 276 | * |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 277 | * <p>Comes from the |
| 278 | * {@link android.R.styleable#AndroidManifestApplication_restoreAnyVersion android:restoreAnyVersion} |
| 279 | * attribute of the <application> tag. |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 280 | */ |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 281 | public static final int FLAG_RESTORE_ANY_VERSION = 1<<17; |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 282 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 283 | /** |
Dianne Hackborn | 3202d38 | 2010-04-26 17:51:34 -0700 | [diff] [blame] | 284 | * Value for {@link #flags}: Set to true if the application is |
| 285 | * currently installed on external/removable/unprotected storage. Such |
| 286 | * applications may not be available if their storage is not currently |
| 287 | * mounted. When the storage it is on is not available, it will look like |
| 288 | * the application has been uninstalled (its .apk is no longer available) |
| 289 | * but its persistent data is not removed. |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 290 | */ |
Dianne Hackborn | 94c567e | 2010-04-26 18:13:10 -0700 | [diff] [blame] | 291 | public static final int FLAG_EXTERNAL_STORAGE = 1<<18; |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 292 | |
| 293 | /** |
Dianne Hackborn | 14cee9f | 2010-04-23 17:51:26 -0700 | [diff] [blame] | 294 | * Value for {@link #flags}: true when the application's window can be |
| 295 | * increased in size for extra large screens. Corresponds to |
| 296 | * {@link android.R.styleable#AndroidManifestSupportsScreens_xlargeScreens |
Dianne Hackborn | 22ec9ab | 2010-04-29 17:56:03 -0700 | [diff] [blame] | 297 | * android:xlargeScreens}. |
Dianne Hackborn | 14cee9f | 2010-04-23 17:51:26 -0700 | [diff] [blame] | 298 | */ |
| 299 | public static final int FLAG_SUPPORTS_XLARGE_SCREENS = 1<<19; |
| 300 | |
| 301 | /** |
Dianne Hackborn | 3b81bc1 | 2011-01-15 11:50:52 -0800 | [diff] [blame] | 302 | * Value for {@link #flags}: true when the application has requested a |
| 303 | * large heap for its processes. Corresponds to |
| 304 | * {@link android.R.styleable#AndroidManifestApplication_largeHeap |
| 305 | * android:largeHeap}. |
Jason parks | a3cdaa5 | 2011-01-13 14:15:43 -0600 | [diff] [blame] | 306 | */ |
Dianne Hackborn | 3b81bc1 | 2011-01-15 11:50:52 -0800 | [diff] [blame] | 307 | public static final int FLAG_LARGE_HEAP = 1<<20; |
Jason parks | a3cdaa5 | 2011-01-13 14:15:43 -0600 | [diff] [blame] | 308 | |
| 309 | /** |
Dianne Hackborn | e7f9721 | 2011-02-24 14:40:20 -0800 | [diff] [blame] | 310 | * Value for {@link #flags}: true if this application's package is in |
| 311 | * the stopped state. |
| 312 | */ |
| 313 | public static final int FLAG_STOPPED = 1<<21; |
| 314 | |
| 315 | /** |
Fabrice Di Meglio | 59dfce8 | 2012-04-02 16:17:20 -0700 | [diff] [blame] | 316 | * Value for {@link #flags}: true when the application is willing to support |
| 317 | * RTL (right to left). All activities will inherit this value. |
| 318 | * |
| 319 | * Set from the {@link android.R.attr#supportsRtl} attribute in the |
| 320 | * activity's manifest. |
| 321 | * |
| 322 | * Default value is false (no support for RTL). |
| 323 | */ |
| 324 | public static final int FLAG_SUPPORTS_RTL = 1<<22; |
| 325 | |
| 326 | /** |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 327 | * Value for {@link #flags}: true if the application is currently |
| 328 | * installed for the calling user. |
| 329 | */ |
| 330 | public static final int FLAG_INSTALLED = 1<<23; |
| 331 | |
| 332 | /** |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 333 | * Value for {@link #flags}: true if the application only has its |
| 334 | * data installed; the application package itself does not currently |
| 335 | * exist on the device. |
| 336 | */ |
| 337 | public static final int FLAG_IS_DATA_ONLY = 1<<24; |
| 338 | |
| 339 | /** |
Jose Lima | 12d0b4c | 2014-03-14 16:55:12 -0700 | [diff] [blame] | 340 | * Value for {@link #flags}: true if the application was declared to be a game, or |
| 341 | * false if it is a non-game application. |
| 342 | */ |
| 343 | public static final int FLAG_IS_GAME = 1<<25; |
| 344 | |
| 345 | /** |
Christopher Tate | d1de256 | 2014-06-17 17:12:35 -0700 | [diff] [blame] | 346 | * Value for {@link #flags}: {@code true} if the application asks that only |
| 347 | * full-data streaming backups of its data be performed even though it defines |
| 348 | * a {@link android.app.backup.BackupAgent BackupAgent}, which normally |
| 349 | * indicates that the app will manage its backed-up data via incremental |
| 350 | * key/value updates. |
| 351 | */ |
| 352 | public static final int FLAG_FULL_BACKUP_ONLY = 1<<26; |
| 353 | |
| 354 | /** |
Alex Klyubin | 01a959d | 2015-03-18 10:05:45 -0700 | [diff] [blame] | 355 | * Value for {@link #flags}: {@code true} if the application may use cleartext network traffic |
| 356 | * (e.g., HTTP rather than HTTPS; WebSockets rather than WebSockets Secure; XMPP, IMAP, STMP |
| 357 | * without STARTTLS or TLS). If {@code false}, the app declares that it does not intend to use |
| 358 | * cleartext network traffic, in which case platform components (e.g., HTTP stacks, |
Alex Klyubin | fbf4599 | 2015-04-21 13:44:29 -0700 | [diff] [blame] | 359 | * {@code DownloadManager}, {@code MediaPlayer}) will refuse app's requests to use cleartext |
| 360 | * traffic. Third-party libraries are encouraged to honor this flag as well. |
| 361 | * |
| 362 | * <p>NOTE: {@code WebView} does not honor this flag. |
| 363 | * |
| 364 | * <p>This flag comes from |
| 365 | * {@link android.R.styleable#AndroidManifestApplication_usesCleartextTraffic |
| 366 | * android:usesCleartextTraffic} of the <application> tag. |
Alex Klyubin | 01a959d | 2015-03-18 10:05:45 -0700 | [diff] [blame] | 367 | */ |
| 368 | public static final int FLAG_USES_CLEARTEXT_TRAFFIC = 1<<27; |
| 369 | |
| 370 | /** |
Dmitriy Ivanov | ff193d6 | 2014-09-30 15:10:48 -0700 | [diff] [blame] | 371 | * When set installer extracts native libs from .apk files. |
| 372 | */ |
| 373 | public static final int FLAG_EXTRACT_NATIVE_LIBS = 1<<28; |
| 374 | |
| 375 | /** |
Narayan Kamath | 589a1bc | 2014-07-03 14:43:26 +0100 | [diff] [blame] | 376 | * Value for {@link #flags}: true if code from this application will need to be |
| 377 | * loaded into other applications' processes. On devices that support multiple |
| 378 | * instruction sets, this implies the code might be loaded into a process that's |
| 379 | * using any of the devices supported instruction sets. |
| 380 | * |
| 381 | * <p> The system might treat such applications specially, for eg., by |
| 382 | * extracting the application's native libraries for all supported instruction |
| 383 | * sets or by compiling the application's dex code for all supported instruction |
| 384 | * sets. |
| 385 | */ |
| 386 | public static final int FLAG_MULTIARCH = 1 << 31; |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 387 | |
| 388 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 389 | * Flags associated with the application. Any combination of |
| 390 | * {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE}, |
| 391 | * {@link #FLAG_PERSISTENT}, {@link #FLAG_FACTORY_TEST}, and |
| 392 | * {@link #FLAG_ALLOW_TASK_REPARENTING} |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 393 | * {@link #FLAG_ALLOW_CLEAR_USER_DATA}, {@link #FLAG_UPDATED_SYSTEM_APP}, |
Dianne Hackborn | 723738c | 2009-06-25 19:48:04 -0700 | [diff] [blame] | 394 | * {@link #FLAG_TEST_ONLY}, {@link #FLAG_SUPPORTS_SMALL_SCREENS}, |
| 395 | * {@link #FLAG_SUPPORTS_NORMAL_SCREENS}, |
Dianne Hackborn | 14cee9f | 2010-04-23 17:51:26 -0700 | [diff] [blame] | 396 | * {@link #FLAG_SUPPORTS_LARGE_SCREENS}, {@link #FLAG_SUPPORTS_XLARGE_SCREENS}, |
| 397 | * {@link #FLAG_RESIZEABLE_FOR_SCREENS}, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 398 | * {@link #FLAG_SUPPORTS_SCREEN_DENSITIES}, {@link #FLAG_VM_SAFE_MODE}, |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 399 | * {@link #FLAG_ALLOW_BACKUP}, {@link #FLAG_KILL_AFTER_RESTORE}, |
| 400 | * {@link #FLAG_RESTORE_ANY_VERSION}, {@link #FLAG_EXTERNAL_STORAGE}, |
| 401 | * {@link #FLAG_LARGE_HEAP}, {@link #FLAG_STOPPED}, |
| 402 | * {@link #FLAG_SUPPORTS_RTL}, {@link #FLAG_INSTALLED}, |
| 403 | * {@link #FLAG_IS_DATA_ONLY}, {@link #FLAG_IS_GAME}, |
Alex Klyubin | 7cb000f | 2015-03-26 11:00:04 -0700 | [diff] [blame] | 404 | * {@link #FLAG_FULL_BACKUP_ONLY}, {@link #FLAG_USES_CLEARTEXT_TRAFFIC}, |
| 405 | * {@link #FLAG_MULTIARCH}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 406 | */ |
| 407 | public int flags = 0; |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 408 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 409 | /** |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 410 | * Value for {@link #privateFlags}: true if the application is hidden via restrictions and for |
| 411 | * most purposes is considered as not installed. |
| 412 | * {@hide} |
| 413 | */ |
| 414 | public static final int PRIVATE_FLAG_HIDDEN = 1<<0; |
| 415 | |
| 416 | /** |
| 417 | * Value for {@link #privateFlags}: set to <code>true</code> if the application |
| 418 | * has reported that it is heavy-weight, and thus can not participate in |
| 419 | * the normal application lifecycle. |
| 420 | * |
| 421 | * <p>Comes from the |
| 422 | * android.R.styleable#AndroidManifestApplication_cantSaveState |
| 423 | * attribute of the <application> tag. |
| 424 | * |
| 425 | * {@hide} |
| 426 | */ |
| 427 | public static final int PRIVATE_FLAG_CANT_SAVE_STATE = 1<<1; |
| 428 | |
| 429 | /** |
| 430 | * Value for {@link #privateFlags}: Set to true if the application has been |
| 431 | * installed using the forward lock option. |
| 432 | * |
| 433 | * NOTE: DO NOT CHANGE THIS VALUE! It is saved in packages.xml. |
| 434 | * |
| 435 | * {@hide} |
| 436 | */ |
| 437 | public static final int PRIVATE_FLAG_FORWARD_LOCK = 1<<2; |
| 438 | |
| 439 | /** |
| 440 | * Value for {@link #privateFlags}: set to {@code true} if the application |
| 441 | * is permitted to hold privileged permissions. |
| 442 | * |
| 443 | * {@hide} |
| 444 | */ |
| 445 | public static final int PRIVATE_FLAG_PRIVILEGED = 1<<3; |
| 446 | |
| 447 | /** |
Fabrice Di Meglio | d3d8a32 | 2015-04-01 15:58:47 -0700 | [diff] [blame] | 448 | * Value for {@link #flags}: {@code true} if the application has any IntentFiler with some |
| 449 | * data URI using HTTP or HTTPS with an associated VIEW action. |
| 450 | * |
| 451 | * {@hide} |
| 452 | */ |
| 453 | public static final int PRIVATE_FLAG_HAS_DOMAIN_URLS = 1<<4; |
| 454 | |
| 455 | /** |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 456 | * Private/hidden flags. See {@code PRIVATE_FLAG_...} constants. |
| 457 | * {@hide} |
| 458 | */ |
| 459 | public int privateFlags; |
| 460 | |
| 461 | /** |
Dianne Hackborn | df6e980 | 2011-05-26 14:20:23 -0700 | [diff] [blame] | 462 | * The required smallest screen width the application can run on. If 0, |
| 463 | * nothing has been specified. Comes from |
| 464 | * {@link android.R.styleable#AndroidManifestSupportsScreens_requiresSmallestWidthDp |
| 465 | * android:requiresSmallestWidthDp} attribute of the <supports-screens> tag. |
| 466 | */ |
| 467 | public int requiresSmallestWidthDp = 0; |
| 468 | |
| 469 | /** |
| 470 | * The maximum smallest screen width the application is designed for. If 0, |
| 471 | * nothing has been specified. Comes from |
| 472 | * {@link android.R.styleable#AndroidManifestSupportsScreens_compatibleWidthLimitDp |
| 473 | * android:compatibleWidthLimitDp} attribute of the <supports-screens> tag. |
| 474 | */ |
| 475 | public int compatibleWidthLimitDp = 0; |
| 476 | |
| 477 | /** |
Dianne Hackborn | 2762ff3 | 2011-06-01 21:27:05 -0700 | [diff] [blame] | 478 | * The maximum smallest screen width the application will work on. If 0, |
| 479 | * nothing has been specified. Comes from |
| 480 | * {@link android.R.styleable#AndroidManifestSupportsScreens_largestWidthLimitDp |
| 481 | * android:largestWidthLimitDp} attribute of the <supports-screens> tag. |
| 482 | */ |
| 483 | public int largestWidthLimitDp = 0; |
| 484 | |
Jeff Sharkey | d746057 | 2014-07-06 20:44:55 -0700 | [diff] [blame] | 485 | /** {@hide} */ |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 486 | public String volumeUuid; |
| 487 | /** {@hide} */ |
Jeff Sharkey | d746057 | 2014-07-06 20:44:55 -0700 | [diff] [blame] | 488 | public String scanSourceDir; |
| 489 | /** {@hide} */ |
| 490 | public String scanPublicSourceDir; |
| 491 | |
Dianne Hackborn | 2762ff3 | 2011-06-01 21:27:05 -0700 | [diff] [blame] | 492 | /** |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 493 | * Full path to the base APK for this application. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 494 | */ |
| 495 | public String sourceDir; |
| 496 | |
| 497 | /** |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 498 | * Full path to the publicly available parts of {@link #sourceDir}, |
| 499 | * including resources and manifest. This may be different from |
| 500 | * {@link #sourceDir} if an application is forward locked. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 501 | */ |
| 502 | public String publicSourceDir; |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 503 | |
| 504 | /** |
| 505 | * Full paths to zero or more split APKs that, when combined with the base |
| 506 | * APK defined in {@link #sourceDir}, form a complete application. |
| 507 | */ |
| 508 | public String[] splitSourceDirs; |
| 509 | |
| 510 | /** |
| 511 | * Full path to the publicly available parts of {@link #splitSourceDirs}, |
| 512 | * including resources and manifest. This may be different from |
| 513 | * {@link #splitSourceDirs} if an application is forward locked. |
| 514 | */ |
| 515 | public String[] splitPublicSourceDirs; |
| 516 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 517 | /** |
Kenny Root | d1ab016 | 2010-01-21 17:27:14 -0800 | [diff] [blame] | 518 | * Full paths to the locations of extra resource packages this application |
| 519 | * uses. This field is only used if there are extra resource packages, |
| 520 | * otherwise it is null. |
Kenny Root | ace5a3f | 2010-02-05 12:59:28 -0800 | [diff] [blame] | 521 | * |
| 522 | * {@hide} |
Kenny Root | d1ab016 | 2010-01-21 17:27:14 -0800 | [diff] [blame] | 523 | */ |
| 524 | public String[] resourceDirs; |
| 525 | |
| 526 | /** |
Robert Craig | 0f40dc9 | 2013-03-25 06:33:03 -0400 | [diff] [blame] | 527 | * String retrieved from the seinfo tag found in selinux policy. This value |
| 528 | * is useful in setting an SELinux security context on the process as well |
| 529 | * as its data directory. |
| 530 | * |
| 531 | * {@hide} |
| 532 | */ |
| 533 | public String seinfo; |
| 534 | |
| 535 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 536 | * Paths to all shared libraries this application is linked against. This |
| 537 | * field is only set if the {@link PackageManager#GET_SHARED_LIBRARY_FILES |
| 538 | * PackageManager.GET_SHARED_LIBRARY_FILES} flag was used when retrieving |
| 539 | * the structure. |
| 540 | */ |
| 541 | public String[] sharedLibraryFiles; |
| 542 | |
| 543 | /** |
| 544 | * Full path to a directory assigned to the package for its persistent |
| 545 | * data. |
| 546 | */ |
| 547 | public String dataDir; |
Kenny Root | 85387d7 | 2010-08-26 10:13:11 -0700 | [diff] [blame] | 548 | |
| 549 | /** |
| 550 | * Full path to the directory where native JNI libraries are stored. |
Kenny Root | 85387d7 | 2010-08-26 10:13:11 -0700 | [diff] [blame] | 551 | */ |
| 552 | public String nativeLibraryDir; |
| 553 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 554 | /** |
Narayan Kamath | 7dba6eb | 2014-07-16 08:53:30 +0100 | [diff] [blame] | 555 | * Full path where unpacked native libraries for {@link #secondaryCpuAbi} |
| 556 | * are stored, if present. |
| 557 | * |
| 558 | * The main reason this exists is for bundled multi-arch apps, where |
| 559 | * it's not trivial to calculate the location of libs for the secondary abi |
| 560 | * given the location of the primary. |
| 561 | * |
| 562 | * TODO: Change the layout of bundled installs so that we can use |
| 563 | * nativeLibraryRootDir & nativeLibraryRootRequiresIsa there as well. |
| 564 | * (e.g {@code [ "/system/app-lib/Foo/arm", "/system/app-lib/Foo/arm64" ]} |
| 565 | * instead of {@code [ "/system/lib/Foo", "/system/lib64/Foo" ]}. |
| 566 | * |
| 567 | * @hide |
| 568 | */ |
| 569 | public String secondaryNativeLibraryDir; |
| 570 | |
| 571 | /** |
Jeff Sharkey | 84f1294 | 2014-07-10 17:48:11 -0700 | [diff] [blame] | 572 | * The root path where unpacked native libraries are stored. |
| 573 | * <p> |
| 574 | * When {@link #nativeLibraryRootRequiresIsa} is set, the libraries are |
| 575 | * placed in ISA-specific subdirectories under this path, otherwise the |
| 576 | * libraries are placed directly at this path. |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 577 | * |
Jeff Sharkey | 84f1294 | 2014-07-10 17:48:11 -0700 | [diff] [blame] | 578 | * @hide |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 579 | */ |
Jeff Sharkey | 84f1294 | 2014-07-10 17:48:11 -0700 | [diff] [blame] | 580 | public String nativeLibraryRootDir; |
| 581 | |
| 582 | /** |
| 583 | * Flag indicating that ISA must be appended to |
| 584 | * {@link #nativeLibraryRootDir} to be useful. |
| 585 | * |
| 586 | * @hide |
| 587 | */ |
| 588 | public boolean nativeLibraryRootRequiresIsa; |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 589 | |
| 590 | /** |
| 591 | * The primary ABI that this application requires, This is inferred from the ABIs |
Ramin Zaghi | ff0c470 | 2014-04-01 15:02:29 +0100 | [diff] [blame] | 592 | * of the native JNI libraries the application bundles. Will be {@code null} |
| 593 | * if this application does not require any particular ABI. |
| 594 | * |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 595 | * If non-null, the application will always be launched with this ABI. |
| 596 | * |
Ramin Zaghi | ff0c470 | 2014-04-01 15:02:29 +0100 | [diff] [blame] | 597 | * {@hide} |
| 598 | */ |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 599 | public String primaryCpuAbi; |
| 600 | |
| 601 | /** |
| 602 | * The secondary ABI for this application. Might be non-null for multi-arch |
| 603 | * installs. The application itself never uses this ABI, but other applications that |
| 604 | * use its code might. |
| 605 | * |
| 606 | * {@hide} |
| 607 | */ |
| 608 | public String secondaryCpuAbi; |
| 609 | |
| 610 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 611 | * The kernel user-ID that has been assigned to this application; |
| 612 | * currently this is not a unique ID (multiple applications can have |
| 613 | * the same uid). |
| 614 | */ |
| 615 | public int uid; |
| 616 | |
Mitsuru Oshima | 8d11267 | 2009-04-27 12:01:23 -0700 | [diff] [blame] | 617 | /** |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 618 | * The minimum SDK version this application targets. It may run on earlier |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 619 | * versions, but it knows how to work with any new behavior added at this |
| 620 | * version. Will be {@link android.os.Build.VERSION_CODES#CUR_DEVELOPMENT} |
| 621 | * if this is a development build and the app is targeting that. You should |
| 622 | * compare that this number is >= the SDK version number at which your |
| 623 | * behavior was introduced. |
| 624 | */ |
| 625 | public int targetSdkVersion; |
Dianne Hackborn | 8472e61 | 2014-01-23 17:57:20 -0800 | [diff] [blame] | 626 | |
| 627 | /** |
| 628 | * The app's declared version code. |
| 629 | * @hide |
| 630 | */ |
| 631 | public int versionCode; |
| 632 | |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 633 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 634 | * When false, indicates that all components within this application are |
| 635 | * considered disabled, regardless of their individually set enabled status. |
| 636 | */ |
| 637 | public boolean enabled = true; |
| 638 | |
Dianne Hackborn | 54e570f | 2010-10-04 18:32:32 -0700 | [diff] [blame] | 639 | /** |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 640 | * For convenient access to the current enabled setting of this app. |
| 641 | * @hide |
| 642 | */ |
| 643 | public int enabledSetting = PackageManager.COMPONENT_ENABLED_STATE_DEFAULT; |
| 644 | |
| 645 | /** |
Dianne Hackborn | 54e570f | 2010-10-04 18:32:32 -0700 | [diff] [blame] | 646 | * For convenient access to package's install location. |
| 647 | * @hide |
| 648 | */ |
| 649 | public int installLocation = PackageInfo.INSTALL_LOCATION_UNSPECIFIED; |
Jose Lima | 12d0b4c | 2014-03-14 16:55:12 -0700 | [diff] [blame] | 650 | |
Alan Viverette | 9b0ab65 | 2015-03-18 14:21:04 -0700 | [diff] [blame] | 651 | /** |
| 652 | * True when the application's rendering should be hardware accelerated. |
| 653 | */ |
| 654 | public boolean hardwareAccelerated; |
| 655 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 656 | public void dump(Printer pw, String prefix) { |
| 657 | super.dumpFront(pw, prefix); |
Dianne Hackborn | 12527f9 | 2009-11-11 17:39:50 -0800 | [diff] [blame] | 658 | if (className != null) { |
| 659 | pw.println(prefix + "className=" + className); |
| 660 | } |
| 661 | if (permission != null) { |
| 662 | pw.println(prefix + "permission=" + permission); |
| 663 | } |
Dianne Hackborn | 39792d2 | 2010-08-19 18:01:52 -0700 | [diff] [blame] | 664 | pw.println(prefix + "processName=" + processName); |
| 665 | pw.println(prefix + "taskAffinity=" + taskAffinity); |
| 666 | pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags) |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 667 | + " privateFlags=0x" + Integer.toHexString(privateFlags) |
Dianne Hackborn | 39792d2 | 2010-08-19 18:01:52 -0700 | [diff] [blame] | 668 | + " theme=0x" + Integer.toHexString(theme)); |
Dianne Hackborn | df6e980 | 2011-05-26 14:20:23 -0700 | [diff] [blame] | 669 | pw.println(prefix + "requiresSmallestWidthDp=" + requiresSmallestWidthDp |
Dianne Hackborn | 2762ff3 | 2011-06-01 21:27:05 -0700 | [diff] [blame] | 670 | + " compatibleWidthLimitDp=" + compatibleWidthLimitDp |
| 671 | + " largestWidthLimitDp=" + largestWidthLimitDp); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 672 | pw.println(prefix + "sourceDir=" + sourceDir); |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 673 | if (!Objects.equals(sourceDir, publicSourceDir)) { |
Dianne Hackborn | 39792d2 | 2010-08-19 18:01:52 -0700 | [diff] [blame] | 674 | pw.println(prefix + "publicSourceDir=" + publicSourceDir); |
| 675 | } |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 676 | if (!ArrayUtils.isEmpty(splitSourceDirs)) { |
| 677 | pw.println(prefix + "splitSourceDirs=" + Arrays.toString(splitSourceDirs)); |
| 678 | } |
| 679 | if (!ArrayUtils.isEmpty(splitPublicSourceDirs) |
| 680 | && !Arrays.equals(splitSourceDirs, splitPublicSourceDirs)) { |
| 681 | pw.println(prefix + "splitPublicSourceDirs=" + Arrays.toString(splitPublicSourceDirs)); |
| 682 | } |
Dianne Hackborn | 39792d2 | 2010-08-19 18:01:52 -0700 | [diff] [blame] | 683 | if (resourceDirs != null) { |
| 684 | pw.println(prefix + "resourceDirs=" + resourceDirs); |
| 685 | } |
Robert Craig | 0f40dc9 | 2013-03-25 06:33:03 -0400 | [diff] [blame] | 686 | if (seinfo != null) { |
| 687 | pw.println(prefix + "seinfo=" + seinfo); |
| 688 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 689 | pw.println(prefix + "dataDir=" + dataDir); |
Dianne Hackborn | 12527f9 | 2009-11-11 17:39:50 -0800 | [diff] [blame] | 690 | if (sharedLibraryFiles != null) { |
Flavio Lerda | dcc36bf | 2015-03-25 10:22:05 +0000 | [diff] [blame] | 691 | pw.println(prefix + "sharedLibraryFiles=" + Arrays.toString(sharedLibraryFiles)); |
Dianne Hackborn | 12527f9 | 2009-11-11 17:39:50 -0800 | [diff] [blame] | 692 | } |
Dianne Hackborn | 8472e61 | 2014-01-23 17:57:20 -0800 | [diff] [blame] | 693 | pw.println(prefix + "enabled=" + enabled + " targetSdkVersion=" + targetSdkVersion |
| 694 | + " versionCode=" + versionCode); |
Alan Viverette | 9b0ab65 | 2015-03-18 14:21:04 -0700 | [diff] [blame] | 695 | pw.println(prefix + "hardwareAccelerated=" + hardwareAccelerated); |
Dianne Hackborn | 12527f9 | 2009-11-11 17:39:50 -0800 | [diff] [blame] | 696 | if (manageSpaceActivityName != null) { |
| 697 | pw.println(prefix + "manageSpaceActivityName="+manageSpaceActivityName); |
| 698 | } |
| 699 | if (descriptionRes != 0) { |
| 700 | pw.println(prefix + "description=0x"+Integer.toHexString(descriptionRes)); |
| 701 | } |
Adam Powell | 269248d | 2011-08-02 10:26:54 -0700 | [diff] [blame] | 702 | if (uiOptions != 0) { |
| 703 | pw.println(prefix + "uiOptions=0x" + Integer.toHexString(uiOptions)); |
| 704 | } |
Fabrice Di Meglio | 59dfce8 | 2012-04-02 16:17:20 -0700 | [diff] [blame] | 705 | pw.println(prefix + "supportsRtl=" + (hasRtlSupport() ? "true" : "false")); |
Matthew Williams | 303650c | 2015-04-17 18:22:51 -0700 | [diff] [blame] | 706 | if (fullBackupContent > 0) { |
| 707 | pw.println(prefix + "fullBackupContent=@xml/" + fullBackupContent); |
| 708 | } else { |
| 709 | pw.println(prefix + "fullBackupContent=" + (fullBackupContent < 0 ? "false" : "true")); |
| 710 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 711 | super.dumpBack(pw, prefix); |
| 712 | } |
Fabrice Di Meglio | 59dfce8 | 2012-04-02 16:17:20 -0700 | [diff] [blame] | 713 | |
| 714 | /** |
| 715 | * @return true if "supportsRtl" has been set to true in the AndroidManifest |
| 716 | * @hide |
| 717 | */ |
| 718 | public boolean hasRtlSupport() { |
| 719 | return (flags & FLAG_SUPPORTS_RTL) == FLAG_SUPPORTS_RTL; |
| 720 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 721 | |
| 722 | public static class DisplayNameComparator |
| 723 | implements Comparator<ApplicationInfo> { |
| 724 | public DisplayNameComparator(PackageManager pm) { |
| 725 | mPM = pm; |
| 726 | } |
| 727 | |
| 728 | public final int compare(ApplicationInfo aa, ApplicationInfo ab) { |
| 729 | CharSequence sa = mPM.getApplicationLabel(aa); |
| 730 | if (sa == null) { |
| 731 | sa = aa.packageName; |
| 732 | } |
| 733 | CharSequence sb = mPM.getApplicationLabel(ab); |
| 734 | if (sb == null) { |
| 735 | sb = ab.packageName; |
| 736 | } |
| 737 | |
| 738 | return sCollator.compare(sa.toString(), sb.toString()); |
| 739 | } |
| 740 | |
| 741 | private final Collator sCollator = Collator.getInstance(); |
| 742 | private PackageManager mPM; |
| 743 | } |
| 744 | |
| 745 | public ApplicationInfo() { |
| 746 | } |
| 747 | |
| 748 | public ApplicationInfo(ApplicationInfo orig) { |
| 749 | super(orig); |
| 750 | taskAffinity = orig.taskAffinity; |
| 751 | permission = orig.permission; |
| 752 | processName = orig.processName; |
| 753 | className = orig.className; |
| 754 | theme = orig.theme; |
| 755 | flags = orig.flags; |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 756 | privateFlags = orig.privateFlags; |
Dianne Hackborn | df6e980 | 2011-05-26 14:20:23 -0700 | [diff] [blame] | 757 | requiresSmallestWidthDp = orig.requiresSmallestWidthDp; |
| 758 | compatibleWidthLimitDp = orig.compatibleWidthLimitDp; |
Dianne Hackborn | 2762ff3 | 2011-06-01 21:27:05 -0700 | [diff] [blame] | 759 | largestWidthLimitDp = orig.largestWidthLimitDp; |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 760 | volumeUuid = orig.volumeUuid; |
Jeff Sharkey | 7f1a57a | 2014-10-08 10:14:53 -0700 | [diff] [blame] | 761 | scanSourceDir = orig.scanSourceDir; |
| 762 | scanPublicSourceDir = orig.scanPublicSourceDir; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 763 | sourceDir = orig.sourceDir; |
| 764 | publicSourceDir = orig.publicSourceDir; |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 765 | splitSourceDirs = orig.splitSourceDirs; |
| 766 | splitPublicSourceDirs = orig.splitPublicSourceDirs; |
Kenny Root | 85387d7 | 2010-08-26 10:13:11 -0700 | [diff] [blame] | 767 | nativeLibraryDir = orig.nativeLibraryDir; |
Narayan Kamath | 7dba6eb | 2014-07-16 08:53:30 +0100 | [diff] [blame] | 768 | secondaryNativeLibraryDir = orig.secondaryNativeLibraryDir; |
Jeff Sharkey | 84f1294 | 2014-07-10 17:48:11 -0700 | [diff] [blame] | 769 | nativeLibraryRootDir = orig.nativeLibraryRootDir; |
| 770 | nativeLibraryRootRequiresIsa = orig.nativeLibraryRootRequiresIsa; |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 771 | primaryCpuAbi = orig.primaryCpuAbi; |
| 772 | secondaryCpuAbi = orig.secondaryCpuAbi; |
Kenny Root | d1ab016 | 2010-01-21 17:27:14 -0800 | [diff] [blame] | 773 | resourceDirs = orig.resourceDirs; |
Robert Craig | 0f40dc9 | 2013-03-25 06:33:03 -0400 | [diff] [blame] | 774 | seinfo = orig.seinfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 775 | sharedLibraryFiles = orig.sharedLibraryFiles; |
| 776 | dataDir = orig.dataDir; |
| 777 | uid = orig.uid; |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 778 | targetSdkVersion = orig.targetSdkVersion; |
Dianne Hackborn | 8472e61 | 2014-01-23 17:57:20 -0800 | [diff] [blame] | 779 | versionCode = orig.versionCode; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 780 | enabled = orig.enabled; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 781 | enabledSetting = orig.enabledSetting; |
Dianne Hackborn | 54e570f | 2010-10-04 18:32:32 -0700 | [diff] [blame] | 782 | installLocation = orig.installLocation; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 783 | manageSpaceActivityName = orig.manageSpaceActivityName; |
| 784 | descriptionRes = orig.descriptionRes; |
Adam Powell | 269248d | 2011-08-02 10:26:54 -0700 | [diff] [blame] | 785 | uiOptions = orig.uiOptions; |
Christopher Tate | bcb0255 | 2012-10-16 17:14:34 -0700 | [diff] [blame] | 786 | backupAgentName = orig.backupAgentName; |
Alan Viverette | 9b0ab65 | 2015-03-18 14:21:04 -0700 | [diff] [blame] | 787 | hardwareAccelerated = orig.hardwareAccelerated; |
Matthew Williams | 303650c | 2015-04-17 18:22:51 -0700 | [diff] [blame] | 788 | fullBackupContent = orig.fullBackupContent; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 789 | } |
| 790 | |
| 791 | |
| 792 | public String toString() { |
| 793 | return "ApplicationInfo{" |
| 794 | + Integer.toHexString(System.identityHashCode(this)) |
| 795 | + " " + packageName + "}"; |
| 796 | } |
| 797 | |
| 798 | public int describeContents() { |
| 799 | return 0; |
| 800 | } |
| 801 | |
| 802 | public void writeToParcel(Parcel dest, int parcelableFlags) { |
| 803 | super.writeToParcel(dest, parcelableFlags); |
| 804 | dest.writeString(taskAffinity); |
| 805 | dest.writeString(permission); |
| 806 | dest.writeString(processName); |
| 807 | dest.writeString(className); |
| 808 | dest.writeInt(theme); |
| 809 | dest.writeInt(flags); |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 810 | dest.writeInt(privateFlags); |
Dianne Hackborn | df6e980 | 2011-05-26 14:20:23 -0700 | [diff] [blame] | 811 | dest.writeInt(requiresSmallestWidthDp); |
| 812 | dest.writeInt(compatibleWidthLimitDp); |
Dianne Hackborn | 2762ff3 | 2011-06-01 21:27:05 -0700 | [diff] [blame] | 813 | dest.writeInt(largestWidthLimitDp); |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 814 | dest.writeString(volumeUuid); |
Jeff Sharkey | 7f1a57a | 2014-10-08 10:14:53 -0700 | [diff] [blame] | 815 | dest.writeString(scanSourceDir); |
| 816 | dest.writeString(scanPublicSourceDir); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 817 | dest.writeString(sourceDir); |
| 818 | dest.writeString(publicSourceDir); |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 819 | dest.writeStringArray(splitSourceDirs); |
| 820 | dest.writeStringArray(splitPublicSourceDirs); |
Kenny Root | 85387d7 | 2010-08-26 10:13:11 -0700 | [diff] [blame] | 821 | dest.writeString(nativeLibraryDir); |
Narayan Kamath | 7dba6eb | 2014-07-16 08:53:30 +0100 | [diff] [blame] | 822 | dest.writeString(secondaryNativeLibraryDir); |
Jeff Sharkey | 84f1294 | 2014-07-10 17:48:11 -0700 | [diff] [blame] | 823 | dest.writeString(nativeLibraryRootDir); |
| 824 | dest.writeInt(nativeLibraryRootRequiresIsa ? 1 : 0); |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 825 | dest.writeString(primaryCpuAbi); |
| 826 | dest.writeString(secondaryCpuAbi); |
Kenny Root | d1ab016 | 2010-01-21 17:27:14 -0800 | [diff] [blame] | 827 | dest.writeStringArray(resourceDirs); |
Robert Craig | 0f40dc9 | 2013-03-25 06:33:03 -0400 | [diff] [blame] | 828 | dest.writeString(seinfo); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 829 | dest.writeStringArray(sharedLibraryFiles); |
| 830 | dest.writeString(dataDir); |
| 831 | dest.writeInt(uid); |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 832 | dest.writeInt(targetSdkVersion); |
Dianne Hackborn | 8472e61 | 2014-01-23 17:57:20 -0800 | [diff] [blame] | 833 | dest.writeInt(versionCode); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 834 | dest.writeInt(enabled ? 1 : 0); |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 835 | dest.writeInt(enabledSetting); |
Dianne Hackborn | 54e570f | 2010-10-04 18:32:32 -0700 | [diff] [blame] | 836 | dest.writeInt(installLocation); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 837 | dest.writeString(manageSpaceActivityName); |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 838 | dest.writeString(backupAgentName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 839 | dest.writeInt(descriptionRes); |
Adam Powell | 269248d | 2011-08-02 10:26:54 -0700 | [diff] [blame] | 840 | dest.writeInt(uiOptions); |
Alan Viverette | 9b0ab65 | 2015-03-18 14:21:04 -0700 | [diff] [blame] | 841 | dest.writeInt(hardwareAccelerated ? 1 : 0); |
Matthew Williams | 303650c | 2015-04-17 18:22:51 -0700 | [diff] [blame] | 842 | dest.writeInt(fullBackupContent); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 843 | } |
| 844 | |
| 845 | public static final Parcelable.Creator<ApplicationInfo> CREATOR |
| 846 | = new Parcelable.Creator<ApplicationInfo>() { |
| 847 | public ApplicationInfo createFromParcel(Parcel source) { |
| 848 | return new ApplicationInfo(source); |
| 849 | } |
| 850 | public ApplicationInfo[] newArray(int size) { |
| 851 | return new ApplicationInfo[size]; |
| 852 | } |
| 853 | }; |
| 854 | |
| 855 | private ApplicationInfo(Parcel source) { |
| 856 | super(source); |
| 857 | taskAffinity = source.readString(); |
| 858 | permission = source.readString(); |
| 859 | processName = source.readString(); |
| 860 | className = source.readString(); |
| 861 | theme = source.readInt(); |
| 862 | flags = source.readInt(); |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 863 | privateFlags = source.readInt(); |
Dianne Hackborn | df6e980 | 2011-05-26 14:20:23 -0700 | [diff] [blame] | 864 | requiresSmallestWidthDp = source.readInt(); |
| 865 | compatibleWidthLimitDp = source.readInt(); |
Dianne Hackborn | 2762ff3 | 2011-06-01 21:27:05 -0700 | [diff] [blame] | 866 | largestWidthLimitDp = source.readInt(); |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 867 | volumeUuid = source.readString(); |
Jeff Sharkey | 7f1a57a | 2014-10-08 10:14:53 -0700 | [diff] [blame] | 868 | scanSourceDir = source.readString(); |
| 869 | scanPublicSourceDir = source.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 870 | sourceDir = source.readString(); |
| 871 | publicSourceDir = source.readString(); |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 872 | splitSourceDirs = source.readStringArray(); |
| 873 | splitPublicSourceDirs = source.readStringArray(); |
Kenny Root | 85387d7 | 2010-08-26 10:13:11 -0700 | [diff] [blame] | 874 | nativeLibraryDir = source.readString(); |
Narayan Kamath | 7dba6eb | 2014-07-16 08:53:30 +0100 | [diff] [blame] | 875 | secondaryNativeLibraryDir = source.readString(); |
Jeff Sharkey | 84f1294 | 2014-07-10 17:48:11 -0700 | [diff] [blame] | 876 | nativeLibraryRootDir = source.readString(); |
| 877 | nativeLibraryRootRequiresIsa = source.readInt() != 0; |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 878 | primaryCpuAbi = source.readString(); |
| 879 | secondaryCpuAbi = source.readString(); |
Kenny Root | d1ab016 | 2010-01-21 17:27:14 -0800 | [diff] [blame] | 880 | resourceDirs = source.readStringArray(); |
Robert Craig | 0f40dc9 | 2013-03-25 06:33:03 -0400 | [diff] [blame] | 881 | seinfo = source.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 882 | sharedLibraryFiles = source.readStringArray(); |
| 883 | dataDir = source.readString(); |
| 884 | uid = source.readInt(); |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 885 | targetSdkVersion = source.readInt(); |
Dianne Hackborn | 8472e61 | 2014-01-23 17:57:20 -0800 | [diff] [blame] | 886 | versionCode = source.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 887 | enabled = source.readInt() != 0; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 888 | enabledSetting = source.readInt(); |
Dianne Hackborn | 54e570f | 2010-10-04 18:32:32 -0700 | [diff] [blame] | 889 | installLocation = source.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 890 | manageSpaceActivityName = source.readString(); |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 891 | backupAgentName = source.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 892 | descriptionRes = source.readInt(); |
Adam Powell | 269248d | 2011-08-02 10:26:54 -0700 | [diff] [blame] | 893 | uiOptions = source.readInt(); |
Alan Viverette | 9b0ab65 | 2015-03-18 14:21:04 -0700 | [diff] [blame] | 894 | hardwareAccelerated = source.readInt() != 0; |
Matthew Williams | 303650c | 2015-04-17 18:22:51 -0700 | [diff] [blame] | 895 | fullBackupContent = source.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 896 | } |
Mitsuru Oshima | 8d11267 | 2009-04-27 12:01:23 -0700 | [diff] [blame] | 897 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 898 | /** |
| 899 | * Retrieve the textual description of the application. This |
| 900 | * will call back on the given PackageManager to load the description from |
| 901 | * the application. |
| 902 | * |
| 903 | * @param pm A PackageManager from which the label can be loaded; usually |
| 904 | * the PackageManager from which you originally retrieved this item. |
| 905 | * |
| 906 | * @return Returns a CharSequence containing the application's description. |
| 907 | * If there is no description, null is returned. |
| 908 | */ |
| 909 | public CharSequence loadDescription(PackageManager pm) { |
| 910 | if (descriptionRes != 0) { |
Jeff Brown | 0733079 | 2010-03-30 19:57:08 -0700 | [diff] [blame] | 911 | CharSequence label = pm.getText(packageName, descriptionRes, this); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 912 | if (label != null) { |
| 913 | return label; |
| 914 | } |
| 915 | } |
| 916 | return null; |
| 917 | } |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 918 | |
| 919 | /** |
| 920 | * Disable compatibility mode |
| 921 | * |
| 922 | * @hide |
| 923 | */ |
| 924 | public void disableCompatibilityMode() { |
Mitsuru Oshima | 69fff4a | 2009-07-21 09:51:05 -0700 | [diff] [blame] | 925 | flags |= (FLAG_SUPPORTS_LARGE_SCREENS | FLAG_SUPPORTS_NORMAL_SCREENS | |
Dianne Hackborn | 11b822d | 2009-07-21 20:03:02 -0700 | [diff] [blame] | 926 | FLAG_SUPPORTS_SMALL_SCREENS | FLAG_RESIZEABLE_FOR_SCREENS | |
Dianne Hackborn | 14cee9f | 2010-04-23 17:51:26 -0700 | [diff] [blame] | 927 | FLAG_SUPPORTS_SCREEN_DENSITIES | FLAG_SUPPORTS_XLARGE_SCREENS); |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 928 | } |
Jeff Brown | 0733079 | 2010-03-30 19:57:08 -0700 | [diff] [blame] | 929 | |
| 930 | /** |
| 931 | * @hide |
| 932 | */ |
Alexandra Gherghina | a709314 | 2014-07-30 13:43:39 +0100 | [diff] [blame] | 933 | @Override |
| 934 | public Drawable loadDefaultIcon(PackageManager pm) { |
Jeff Brown | 0733079 | 2010-03-30 19:57:08 -0700 | [diff] [blame] | 935 | if ((flags & FLAG_EXTERNAL_STORAGE) != 0 |
| 936 | && isPackageUnavailable(pm)) { |
| 937 | return Resources.getSystem().getDrawable( |
| 938 | com.android.internal.R.drawable.sym_app_on_sd_unavailable_icon); |
| 939 | } |
| 940 | return pm.getDefaultActivityIcon(); |
| 941 | } |
| 942 | |
| 943 | private boolean isPackageUnavailable(PackageManager pm) { |
| 944 | try { |
| 945 | return pm.getPackageInfo(packageName, 0) == null; |
| 946 | } catch (NameNotFoundException ex) { |
| 947 | return true; |
| 948 | } |
| 949 | } |
Jeff Sharkey | d746057 | 2014-07-06 20:44:55 -0700 | [diff] [blame] | 950 | |
Jeff Brown | 0733079 | 2010-03-30 19:57:08 -0700 | [diff] [blame] | 951 | /** |
| 952 | * @hide |
| 953 | */ |
Fyodor Kupolov | eeea67b | 2015-02-23 17:14:45 -0800 | [diff] [blame] | 954 | public boolean isForwardLocked() { |
| 955 | return (privateFlags & ApplicationInfo.PRIVATE_FLAG_FORWARD_LOCK) != 0; |
| 956 | } |
| 957 | |
| 958 | /** |
| 959 | * @hide |
| 960 | */ |
Fyodor Kupolov | b94c165 | 2015-03-03 12:25:30 -0800 | [diff] [blame] | 961 | public boolean isSystemApp() { |
| 962 | return (flags & ApplicationInfo.FLAG_SYSTEM) != 0; |
| 963 | } |
| 964 | |
| 965 | /** |
| 966 | * @hide |
| 967 | */ |
| 968 | public boolean isUpdatedSystemApp() { |
| 969 | return (flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0; |
| 970 | } |
| 971 | |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 972 | /** @hide */ |
| 973 | public boolean isInternal() { |
| 974 | return (flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) == 0; |
| 975 | } |
| 976 | |
| 977 | /** @hide */ |
| 978 | public boolean isExternalAsec() { |
| 979 | return TextUtils.isEmpty(volumeUuid) |
| 980 | && (flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0; |
| 981 | } |
| 982 | |
Fyodor Kupolov | b94c165 | 2015-03-03 12:25:30 -0800 | [diff] [blame] | 983 | /** |
| 984 | * @hide |
| 985 | */ |
Jeff Brown | 0733079 | 2010-03-30 19:57:08 -0700 | [diff] [blame] | 986 | @Override protected ApplicationInfo getApplicationInfo() { |
| 987 | return this; |
| 988 | } |
Jeff Sharkey | d746057 | 2014-07-06 20:44:55 -0700 | [diff] [blame] | 989 | |
| 990 | /** {@hide} */ public void setCodePath(String codePath) { scanSourceDir = codePath; } |
| 991 | /** {@hide} */ public void setBaseCodePath(String baseCodePath) { sourceDir = baseCodePath; } |
| 992 | /** {@hide} */ public void setSplitCodePaths(String[] splitCodePaths) { splitSourceDirs = splitCodePaths; } |
| 993 | /** {@hide} */ public void setResourcePath(String resourcePath) { scanPublicSourceDir = resourcePath; } |
| 994 | /** {@hide} */ public void setBaseResourcePath(String baseResourcePath) { publicSourceDir = baseResourcePath; } |
| 995 | /** {@hide} */ public void setSplitResourcePaths(String[] splitResourcePaths) { splitPublicSourceDirs = splitResourcePaths; } |
| 996 | |
| 997 | /** {@hide} */ public String getCodePath() { return scanSourceDir; } |
| 998 | /** {@hide} */ public String getBaseCodePath() { return sourceDir; } |
| 999 | /** {@hide} */ public String[] getSplitCodePaths() { return splitSourceDirs; } |
| 1000 | /** {@hide} */ public String getResourcePath() { return scanPublicSourceDir; } |
| 1001 | /** {@hide} */ public String getBaseResourcePath() { return publicSourceDir; } |
| 1002 | /** {@hide} */ public String[] getSplitResourcePaths() { return splitSourceDirs; } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1003 | } |