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 Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 19 | import static android.os.Build.VERSION_CODES.DONUT; |
| 20 | |
| 21 | import android.annotation.IntDef; |
Alan Viverette | b6a2573 | 2017-11-21 14:49:24 -0500 | [diff] [blame^] | 22 | import android.annotation.Nullable; |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 23 | import android.annotation.SystemApi; |
Jeff Sharkey | a73b8fd | 2016-01-06 17:02:08 -0700 | [diff] [blame] | 24 | import android.annotation.TestApi; |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 25 | import android.content.Context; |
Jeff Brown | 0733079 | 2010-03-30 19:57:08 -0700 | [diff] [blame] | 26 | import android.content.pm.PackageManager.NameNotFoundException; |
| 27 | import android.content.res.Resources; |
| 28 | import android.graphics.drawable.Drawable; |
Jeff Sharkey | 1544779 | 2015-11-05 16:18:51 -0800 | [diff] [blame] | 29 | import android.os.Environment; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 30 | import android.os.Parcel; |
| 31 | import android.os.Parcelable; |
Jeff Sharkey | 1544779 | 2015-11-05 16:18:51 -0800 | [diff] [blame] | 32 | import android.os.UserHandle; |
Jeff Sharkey | 789a8fc | 2017-04-16 13:18:35 -0600 | [diff] [blame] | 33 | import android.os.storage.StorageManager; |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 34 | import android.text.TextUtils; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 35 | import android.util.Printer; |
Adam Lesinski | 1665d0f | 2017-03-10 14:46:57 -0800 | [diff] [blame] | 36 | import android.util.SparseArray; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 37 | |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 38 | import com.android.internal.util.ArrayUtils; |
| 39 | |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 40 | import java.lang.annotation.Retention; |
| 41 | import java.lang.annotation.RetentionPolicy; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 42 | import java.text.Collator; |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 43 | import java.util.Arrays; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 44 | import java.util.Comparator; |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 45 | import java.util.Objects; |
Jeff Sharkey | 789a8fc | 2017-04-16 13:18:35 -0600 | [diff] [blame] | 46 | import java.util.UUID; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 47 | |
| 48 | /** |
| 49 | * Information you can retrieve about a particular application. This |
| 50 | * corresponds to information collected from the AndroidManifest.xml's |
| 51 | * <application> tag. |
| 52 | */ |
| 53 | public class ApplicationInfo extends PackageItemInfo implements Parcelable { |
| 54 | |
| 55 | /** |
| 56 | * Default task affinity of all activities in this application. See |
| 57 | * {@link ActivityInfo#taskAffinity} for more information. This comes |
| 58 | * from the "taskAffinity" attribute. |
| 59 | */ |
| 60 | public String taskAffinity; |
| 61 | |
| 62 | /** |
| 63 | * Optional name of a permission required to be able to access this |
| 64 | * application's components. From the "permission" attribute. |
| 65 | */ |
| 66 | public String permission; |
| 67 | |
| 68 | /** |
| 69 | * The name of the process this application should run in. From the |
| 70 | * "process" attribute or, if not set, the same as |
| 71 | * <var>packageName</var>. |
| 72 | */ |
| 73 | public String processName; |
| 74 | |
| 75 | /** |
| 76 | * Class implementing the Application object. From the "class" |
| 77 | * attribute. |
| 78 | */ |
| 79 | public String className; |
| 80 | |
| 81 | /** |
| 82 | * A style resource identifier (in the package's resources) of the |
| 83 | * description of an application. From the "description" attribute |
| 84 | * or, if not set, 0. |
| 85 | */ |
| 86 | public int descriptionRes; |
| 87 | |
| 88 | /** |
| 89 | * A style resource identifier (in the package's resources) of the |
| 90 | * default visual theme of the application. From the "theme" attribute |
| 91 | * or, if not set, 0. |
| 92 | */ |
| 93 | public int theme; |
| 94 | |
| 95 | /** |
| 96 | * Class implementing the Application's manage space |
| 97 | * functionality. From the "manageSpaceActivity" |
| 98 | * attribute. This is an optional attribute and will be null if |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 99 | * applications don't specify it in their manifest |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 100 | */ |
| 101 | public String manageSpaceActivityName; |
| 102 | |
| 103 | /** |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 104 | * Class implementing the Application's backup functionality. From |
| 105 | * the "backupAgent" attribute. This is an optional attribute and |
| 106 | * will be null if the application does not specify it in its manifest. |
| 107 | * |
| 108 | * <p>If android:allowBackup is set to false, this attribute is ignored. |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 109 | */ |
| 110 | public String backupAgentName; |
Christopher Tate | 4a627c7 | 2011-04-01 14:43:32 -0700 | [diff] [blame] | 111 | |
| 112 | /** |
Matthew Williams | 303650c | 2015-04-17 18:22:51 -0700 | [diff] [blame] | 113 | * An optional attribute that indicates the app supports automatic backup of app data. |
| 114 | * <p>0 is the default and means the app's entire data folder + managed external storage will |
| 115 | * be backed up; |
| 116 | * Any negative value indicates the app does not support full-data backup, though it may still |
| 117 | * want to participate via the traditional key/value backup API; |
| 118 | * A positive number specifies an xml resource in which the application has defined its backup |
| 119 | * include/exclude criteria. |
| 120 | * <p>If android:allowBackup is set to false, this attribute is ignored. |
| 121 | * |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 122 | * @see android.content.Context#getNoBackupFilesDir() |
| 123 | * @see #FLAG_ALLOW_BACKUP |
Christopher Tate | 98fa656 | 2015-05-14 13:20:10 -0700 | [diff] [blame] | 124 | * |
| 125 | * @hide |
Matthew Williams | 303650c | 2015-04-17 18:22:51 -0700 | [diff] [blame] | 126 | */ |
| 127 | public int fullBackupContent = 0; |
| 128 | |
| 129 | /** |
Adam Powell | 269248d | 2011-08-02 10:26:54 -0700 | [diff] [blame] | 130 | * The default extra UI options for activities in this application. |
| 131 | * Set from the {@link android.R.attr#uiOptions} attribute in the |
| 132 | * activity's manifest. |
| 133 | */ |
| 134 | public int uiOptions = 0; |
| 135 | |
| 136 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 137 | * Value for {@link #flags}: if set, this application is installed in the |
| 138 | * device's system image. |
| 139 | */ |
| 140 | public static final int FLAG_SYSTEM = 1<<0; |
| 141 | |
| 142 | /** |
| 143 | * Value for {@link #flags}: set to true if this application would like to |
| 144 | * allow debugging of its |
| 145 | * code, even when installed on a non-development system. Comes |
| 146 | * from {@link android.R.styleable#AndroidManifestApplication_debuggable |
| 147 | * android:debuggable} of the <application> tag. |
| 148 | */ |
| 149 | public static final int FLAG_DEBUGGABLE = 1<<1; |
| 150 | |
| 151 | /** |
| 152 | * Value for {@link #flags}: set to true if this application has code |
| 153 | * associated with it. Comes |
| 154 | * from {@link android.R.styleable#AndroidManifestApplication_hasCode |
| 155 | * android:hasCode} of the <application> tag. |
| 156 | */ |
| 157 | public static final int FLAG_HAS_CODE = 1<<2; |
| 158 | |
| 159 | /** |
| 160 | * Value for {@link #flags}: set to true if this application is persistent. |
| 161 | * Comes from {@link android.R.styleable#AndroidManifestApplication_persistent |
| 162 | * android:persistent} of the <application> tag. |
| 163 | */ |
| 164 | public static final int FLAG_PERSISTENT = 1<<3; |
| 165 | |
| 166 | /** |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 167 | * 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] | 168 | * {@link android.Manifest.permission#FACTORY_TEST} permission and the |
| 169 | * device is running in factory test mode. |
| 170 | */ |
| 171 | public static final int FLAG_FACTORY_TEST = 1<<4; |
| 172 | |
| 173 | /** |
| 174 | * Value for {@link #flags}: default value for the corresponding ActivityInfo flag. |
| 175 | * Comes from {@link android.R.styleable#AndroidManifestApplication_allowTaskReparenting |
| 176 | * android:allowTaskReparenting} of the <application> tag. |
| 177 | */ |
| 178 | public static final int FLAG_ALLOW_TASK_REPARENTING = 1<<5; |
| 179 | |
| 180 | /** |
| 181 | * Value for {@link #flags}: default value for the corresponding ActivityInfo flag. |
| 182 | * Comes from {@link android.R.styleable#AndroidManifestApplication_allowClearUserData |
| 183 | * android:allowClearUserData} of the <application> tag. |
| 184 | */ |
| 185 | public static final int FLAG_ALLOW_CLEAR_USER_DATA = 1<<6; |
| 186 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 187 | /** |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 188 | * Value for {@link #flags}: this is set if this application has been |
Kweku Adams | 8de29ca | 2016-01-22 12:30:26 -0800 | [diff] [blame] | 189 | * installed as an update to a built-in system application. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 190 | */ |
| 191 | public static final int FLAG_UPDATED_SYSTEM_APP = 1<<7; |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 192 | |
| 193 | /** |
Svet Ganov | 354cd3c | 2015-12-17 11:35:04 -0800 | [diff] [blame] | 194 | * Value for {@link #flags}: this is set if the application has specified |
Dianne Hackborn | 7f20543 | 2009-07-28 00:13:47 -0700 | [diff] [blame] | 195 | * {@link android.R.styleable#AndroidManifestApplication_testOnly |
| 196 | * android:testOnly} to be true. |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 197 | */ |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 198 | public static final int FLAG_TEST_ONLY = 1<<8; |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 199 | |
| 200 | /** |
Dianne Hackborn | 5c1e00b | 2009-06-18 17:10:57 -0700 | [diff] [blame] | 201 | * Value for {@link #flags}: true when the application's window can be |
Dianne Hackborn | 723738c | 2009-06-25 19:48:04 -0700 | [diff] [blame] | 202 | * reduced in size for smaller screens. Corresponds to |
| 203 | * {@link android.R.styleable#AndroidManifestSupportsScreens_smallScreens |
| 204 | * android:smallScreens}. |
Dianne Hackborn | 5c1e00b | 2009-06-18 17:10:57 -0700 | [diff] [blame] | 205 | */ |
Dianne Hackborn | 723738c | 2009-06-25 19:48:04 -0700 | [diff] [blame] | 206 | public static final int FLAG_SUPPORTS_SMALL_SCREENS = 1<<9; |
| 207 | |
| 208 | /** |
| 209 | * Value for {@link #flags}: true when the application's window can be |
| 210 | * displayed on normal screens. Corresponds to |
| 211 | * {@link android.R.styleable#AndroidManifestSupportsScreens_normalScreens |
| 212 | * android:normalScreens}. |
| 213 | */ |
| 214 | public static final int FLAG_SUPPORTS_NORMAL_SCREENS = 1<<10; |
| 215 | |
| 216 | /** |
| 217 | * Value for {@link #flags}: true when the application's window can be |
| 218 | * increased in size for larger screens. Corresponds to |
| 219 | * {@link android.R.styleable#AndroidManifestSupportsScreens_largeScreens |
Dianne Hackborn | 22ec9ab | 2010-04-29 17:56:03 -0700 | [diff] [blame] | 220 | * android:largeScreens}. |
Dianne Hackborn | 723738c | 2009-06-25 19:48:04 -0700 | [diff] [blame] | 221 | */ |
| 222 | public static final int FLAG_SUPPORTS_LARGE_SCREENS = 1<<11; |
Dianne Hackborn | 5c1e00b | 2009-06-18 17:10:57 -0700 | [diff] [blame] | 223 | |
| 224 | /** |
Dianne Hackborn | c4db95c | 2009-07-21 17:46:02 -0700 | [diff] [blame] | 225 | * Value for {@link #flags}: true when the application knows how to adjust |
| 226 | * its UI for different screen sizes. Corresponds to |
| 227 | * {@link android.R.styleable#AndroidManifestSupportsScreens_resizeable |
| 228 | * android:resizeable}. |
| 229 | */ |
| 230 | public static final int FLAG_RESIZEABLE_FOR_SCREENS = 1<<12; |
| 231 | |
| 232 | /** |
Dianne Hackborn | 11b822d | 2009-07-21 20:03:02 -0700 | [diff] [blame] | 233 | * Value for {@link #flags}: true when the application knows how to |
| 234 | * accomodate different screen densities. Corresponds to |
| 235 | * {@link android.R.styleable#AndroidManifestSupportsScreens_anyDensity |
| 236 | * android:anyDensity}. |
| 237 | */ |
| 238 | public static final int FLAG_SUPPORTS_SCREEN_DENSITIES = 1<<13; |
| 239 | |
| 240 | /** |
Ben Cheng | 23085b7 | 2010-02-08 16:06:32 -0800 | [diff] [blame] | 241 | * Value for {@link #flags}: set to true if this application would like to |
| 242 | * request the VM to operate under the safe mode. Comes from |
Ben Cheng | ef3f5dd | 2010-03-29 15:47:26 -0700 | [diff] [blame] | 243 | * {@link android.R.styleable#AndroidManifestApplication_vmSafeMode |
| 244 | * android:vmSafeMode} of the <application> tag. |
Ben Cheng | 23085b7 | 2010-02-08 16:06:32 -0800 | [diff] [blame] | 245 | */ |
| 246 | public static final int FLAG_VM_SAFE_MODE = 1<<14; |
| 247 | |
| 248 | /** |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 249 | * Value for {@link #flags}: set to <code>false</code> if the application does not wish |
| 250 | * 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] | 251 | * |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 252 | * <p>Comes from the |
| 253 | * {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup} |
| 254 | * attribute of the <application> tag. |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 255 | */ |
Ben Cheng | 23085b7 | 2010-02-08 16:06:32 -0800 | [diff] [blame] | 256 | public static final int FLAG_ALLOW_BACKUP = 1<<15; |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 257 | |
| 258 | /** |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 259 | * Value for {@link #flags}: set to <code>false</code> if the application must be kept |
| 260 | * in memory following a full-system restore operation; <code>true</code> otherwise. |
| 261 | * Ordinarily, during a full system restore operation each application is shut down |
| 262 | * following execution of its agent's onRestore() method. Setting this attribute to |
| 263 | * <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] | 264 | * |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 265 | * <p>If |
| 266 | * {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup} |
| 267 | * is set to <code>false</code> or no |
| 268 | * {@link android.R.styleable#AndroidManifestApplication_backupAgent android:backupAgent} |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 269 | * is specified, this flag will be ignored. |
| 270 | * |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 271 | * <p>Comes from the |
| 272 | * {@link android.R.styleable#AndroidManifestApplication_killAfterRestore android:killAfterRestore} |
| 273 | * attribute of the <application> tag. |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 274 | */ |
Ben Cheng | 23085b7 | 2010-02-08 16:06:32 -0800 | [diff] [blame] | 275 | public static final int FLAG_KILL_AFTER_RESTORE = 1<<16; |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 276 | |
| 277 | /** |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 278 | * Value for {@link #flags}: Set to <code>true</code> if the application's backup |
| 279 | * agent claims to be able to handle restore data even "from the future," |
| 280 | * i.e. from versions of the application with a versionCode greater than |
| 281 | * the one currently installed on the device. <i>Use with caution!</i> By default |
| 282 | * this attribute is <code>false</code> and the Backup Manager will ensure that data |
| 283 | * 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] | 284 | * |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 285 | * <p>If |
| 286 | * {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup} |
| 287 | * is set to <code>false</code> or no |
| 288 | * {@link android.R.styleable#AndroidManifestApplication_backupAgent android:backupAgent} |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 289 | * is specified, this flag will be ignored. |
| 290 | * |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 291 | * <p>Comes from the |
| 292 | * {@link android.R.styleable#AndroidManifestApplication_restoreAnyVersion android:restoreAnyVersion} |
| 293 | * attribute of the <application> tag. |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 294 | */ |
Christopher Tate | 3de55bc | 2010-03-12 17:28:08 -0800 | [diff] [blame] | 295 | public static final int FLAG_RESTORE_ANY_VERSION = 1<<17; |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 296 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 297 | /** |
Dianne Hackborn | 3202d38 | 2010-04-26 17:51:34 -0700 | [diff] [blame] | 298 | * Value for {@link #flags}: Set to true if the application is |
| 299 | * currently installed on external/removable/unprotected storage. Such |
| 300 | * applications may not be available if their storage is not currently |
| 301 | * mounted. When the storage it is on is not available, it will look like |
| 302 | * the application has been uninstalled (its .apk is no longer available) |
| 303 | * but its persistent data is not removed. |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 304 | */ |
Dianne Hackborn | 94c567e | 2010-04-26 18:13:10 -0700 | [diff] [blame] | 305 | public static final int FLAG_EXTERNAL_STORAGE = 1<<18; |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 306 | |
| 307 | /** |
Dianne Hackborn | 14cee9f | 2010-04-23 17:51:26 -0700 | [diff] [blame] | 308 | * Value for {@link #flags}: true when the application's window can be |
| 309 | * increased in size for extra large screens. Corresponds to |
| 310 | * {@link android.R.styleable#AndroidManifestSupportsScreens_xlargeScreens |
Dianne Hackborn | 22ec9ab | 2010-04-29 17:56:03 -0700 | [diff] [blame] | 311 | * android:xlargeScreens}. |
Dianne Hackborn | 14cee9f | 2010-04-23 17:51:26 -0700 | [diff] [blame] | 312 | */ |
| 313 | public static final int FLAG_SUPPORTS_XLARGE_SCREENS = 1<<19; |
| 314 | |
| 315 | /** |
Dianne Hackborn | 3b81bc1 | 2011-01-15 11:50:52 -0800 | [diff] [blame] | 316 | * Value for {@link #flags}: true when the application has requested a |
| 317 | * large heap for its processes. Corresponds to |
| 318 | * {@link android.R.styleable#AndroidManifestApplication_largeHeap |
| 319 | * android:largeHeap}. |
Jason parks | a3cdaa5 | 2011-01-13 14:15:43 -0600 | [diff] [blame] | 320 | */ |
Dianne Hackborn | 3b81bc1 | 2011-01-15 11:50:52 -0800 | [diff] [blame] | 321 | public static final int FLAG_LARGE_HEAP = 1<<20; |
Jason parks | a3cdaa5 | 2011-01-13 14:15:43 -0600 | [diff] [blame] | 322 | |
| 323 | /** |
Dianne Hackborn | e7f9721 | 2011-02-24 14:40:20 -0800 | [diff] [blame] | 324 | * Value for {@link #flags}: true if this application's package is in |
| 325 | * the stopped state. |
| 326 | */ |
| 327 | public static final int FLAG_STOPPED = 1<<21; |
| 328 | |
| 329 | /** |
Fabrice Di Meglio | 59dfce8 | 2012-04-02 16:17:20 -0700 | [diff] [blame] | 330 | * Value for {@link #flags}: true when the application is willing to support |
| 331 | * RTL (right to left). All activities will inherit this value. |
| 332 | * |
| 333 | * Set from the {@link android.R.attr#supportsRtl} attribute in the |
| 334 | * activity's manifest. |
| 335 | * |
| 336 | * Default value is false (no support for RTL). |
| 337 | */ |
| 338 | public static final int FLAG_SUPPORTS_RTL = 1<<22; |
| 339 | |
| 340 | /** |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 341 | * Value for {@link #flags}: true if the application is currently |
| 342 | * installed for the calling user. |
| 343 | */ |
| 344 | public static final int FLAG_INSTALLED = 1<<23; |
| 345 | |
| 346 | /** |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 347 | * Value for {@link #flags}: true if the application only has its |
| 348 | * data installed; the application package itself does not currently |
| 349 | * exist on the device. |
| 350 | */ |
| 351 | public static final int FLAG_IS_DATA_ONLY = 1<<24; |
| 352 | |
| 353 | /** |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 354 | * Value for {@link #flags}: true if the application was declared to be a |
| 355 | * game, or false if it is a non-game application. |
| 356 | * |
| 357 | * @deprecated use {@link #CATEGORY_GAME} instead. |
Jose Lima | 12d0b4c | 2014-03-14 16:55:12 -0700 | [diff] [blame] | 358 | */ |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 359 | @Deprecated |
Jose Lima | 12d0b4c | 2014-03-14 16:55:12 -0700 | [diff] [blame] | 360 | public static final int FLAG_IS_GAME = 1<<25; |
| 361 | |
| 362 | /** |
Christopher Tate | d1de256 | 2014-06-17 17:12:35 -0700 | [diff] [blame] | 363 | * Value for {@link #flags}: {@code true} if the application asks that only |
| 364 | * full-data streaming backups of its data be performed even though it defines |
| 365 | * a {@link android.app.backup.BackupAgent BackupAgent}, which normally |
| 366 | * indicates that the app will manage its backed-up data via incremental |
| 367 | * key/value updates. |
| 368 | */ |
| 369 | public static final int FLAG_FULL_BACKUP_ONLY = 1<<26; |
| 370 | |
| 371 | /** |
Alex Klyubin | 01a959d | 2015-03-18 10:05:45 -0700 | [diff] [blame] | 372 | * Value for {@link #flags}: {@code true} if the application may use cleartext network traffic |
| 373 | * (e.g., HTTP rather than HTTPS; WebSockets rather than WebSockets Secure; XMPP, IMAP, STMP |
| 374 | * without STARTTLS or TLS). If {@code false}, the app declares that it does not intend to use |
| 375 | * cleartext network traffic, in which case platform components (e.g., HTTP stacks, |
Alex Klyubin | fbf4599 | 2015-04-21 13:44:29 -0700 | [diff] [blame] | 376 | * {@code DownloadManager}, {@code MediaPlayer}) will refuse app's requests to use cleartext |
| 377 | * traffic. Third-party libraries are encouraged to honor this flag as well. |
| 378 | * |
Nate Fischer | 6a2a541 | 2017-10-23 18:02:41 -0700 | [diff] [blame] | 379 | * <p>NOTE: {@code WebView} honors this flag for applications targeting API level 26 and up. |
Alex Klyubin | fbf4599 | 2015-04-21 13:44:29 -0700 | [diff] [blame] | 380 | * |
Chad Brubaker | 2df5ba7 | 2016-04-11 13:31:24 -0700 | [diff] [blame] | 381 | * <p>This flag is ignored on Android N and above if an Android Network Security Config is |
| 382 | * present. |
| 383 | * |
Alex Klyubin | fbf4599 | 2015-04-21 13:44:29 -0700 | [diff] [blame] | 384 | * <p>This flag comes from |
| 385 | * {@link android.R.styleable#AndroidManifestApplication_usesCleartextTraffic |
| 386 | * android:usesCleartextTraffic} of the <application> tag. |
Alex Klyubin | 01a959d | 2015-03-18 10:05:45 -0700 | [diff] [blame] | 387 | */ |
| 388 | public static final int FLAG_USES_CLEARTEXT_TRAFFIC = 1<<27; |
| 389 | |
| 390 | /** |
Dmitriy Ivanov | ff193d6 | 2014-09-30 15:10:48 -0700 | [diff] [blame] | 391 | * When set installer extracts native libs from .apk files. |
| 392 | */ |
| 393 | public static final int FLAG_EXTRACT_NATIVE_LIBS = 1<<28; |
| 394 | |
| 395 | /** |
Alan Viverette | d70b9e7 | 2015-05-27 14:29:20 -0700 | [diff] [blame] | 396 | * Value for {@link #flags}: {@code true} when the application's rendering |
| 397 | * should be hardware accelerated. |
| 398 | */ |
| 399 | public static final int FLAG_HARDWARE_ACCELERATED = 1<<29; |
| 400 | |
| 401 | /** |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 402 | * Value for {@link #flags}: true if this application's package is in |
| 403 | * the suspended state. |
| 404 | */ |
| 405 | public static final int FLAG_SUSPENDED = 1<<30; |
| 406 | |
| 407 | /** |
Narayan Kamath | 589a1bc | 2014-07-03 14:43:26 +0100 | [diff] [blame] | 408 | * Value for {@link #flags}: true if code from this application will need to be |
| 409 | * loaded into other applications' processes. On devices that support multiple |
| 410 | * instruction sets, this implies the code might be loaded into a process that's |
| 411 | * using any of the devices supported instruction sets. |
| 412 | * |
| 413 | * <p> The system might treat such applications specially, for eg., by |
| 414 | * extracting the application's native libraries for all supported instruction |
| 415 | * sets or by compiling the application's dex code for all supported instruction |
| 416 | * sets. |
| 417 | */ |
| 418 | public static final int FLAG_MULTIARCH = 1 << 31; |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 419 | |
| 420 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 421 | * Flags associated with the application. Any combination of |
| 422 | * {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE}, |
| 423 | * {@link #FLAG_PERSISTENT}, {@link #FLAG_FACTORY_TEST}, and |
| 424 | * {@link #FLAG_ALLOW_TASK_REPARENTING} |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 425 | * {@link #FLAG_ALLOW_CLEAR_USER_DATA}, {@link #FLAG_UPDATED_SYSTEM_APP}, |
Dianne Hackborn | 723738c | 2009-06-25 19:48:04 -0700 | [diff] [blame] | 426 | * {@link #FLAG_TEST_ONLY}, {@link #FLAG_SUPPORTS_SMALL_SCREENS}, |
| 427 | * {@link #FLAG_SUPPORTS_NORMAL_SCREENS}, |
Dianne Hackborn | 14cee9f | 2010-04-23 17:51:26 -0700 | [diff] [blame] | 428 | * {@link #FLAG_SUPPORTS_LARGE_SCREENS}, {@link #FLAG_SUPPORTS_XLARGE_SCREENS}, |
| 429 | * {@link #FLAG_RESIZEABLE_FOR_SCREENS}, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 430 | * {@link #FLAG_SUPPORTS_SCREEN_DENSITIES}, {@link #FLAG_VM_SAFE_MODE}, |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 431 | * {@link #FLAG_ALLOW_BACKUP}, {@link #FLAG_KILL_AFTER_RESTORE}, |
| 432 | * {@link #FLAG_RESTORE_ANY_VERSION}, {@link #FLAG_EXTERNAL_STORAGE}, |
| 433 | * {@link #FLAG_LARGE_HEAP}, {@link #FLAG_STOPPED}, |
| 434 | * {@link #FLAG_SUPPORTS_RTL}, {@link #FLAG_INSTALLED}, |
| 435 | * {@link #FLAG_IS_DATA_ONLY}, {@link #FLAG_IS_GAME}, |
Alex Klyubin | 7cb000f | 2015-03-26 11:00:04 -0700 | [diff] [blame] | 436 | * {@link #FLAG_FULL_BACKUP_ONLY}, {@link #FLAG_USES_CLEARTEXT_TRAFFIC}, |
| 437 | * {@link #FLAG_MULTIARCH}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 438 | */ |
| 439 | public int flags = 0; |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 440 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 441 | /** |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 442 | * Value for {@link #privateFlags}: true if the application is hidden via restrictions and for |
| 443 | * most purposes is considered as not installed. |
| 444 | * {@hide} |
| 445 | */ |
| 446 | public static final int PRIVATE_FLAG_HIDDEN = 1<<0; |
| 447 | |
| 448 | /** |
| 449 | * Value for {@link #privateFlags}: set to <code>true</code> if the application |
| 450 | * has reported that it is heavy-weight, and thus can not participate in |
| 451 | * the normal application lifecycle. |
| 452 | * |
| 453 | * <p>Comes from the |
| 454 | * android.R.styleable#AndroidManifestApplication_cantSaveState |
| 455 | * attribute of the <application> tag. |
| 456 | * |
| 457 | * {@hide} |
| 458 | */ |
| 459 | public static final int PRIVATE_FLAG_CANT_SAVE_STATE = 1<<1; |
| 460 | |
| 461 | /** |
| 462 | * Value for {@link #privateFlags}: Set to true if the application has been |
| 463 | * installed using the forward lock option. |
| 464 | * |
| 465 | * NOTE: DO NOT CHANGE THIS VALUE! It is saved in packages.xml. |
| 466 | * |
| 467 | * {@hide} |
| 468 | */ |
| 469 | public static final int PRIVATE_FLAG_FORWARD_LOCK = 1<<2; |
| 470 | |
| 471 | /** |
| 472 | * Value for {@link #privateFlags}: set to {@code true} if the application |
| 473 | * is permitted to hold privileged permissions. |
| 474 | * |
| 475 | * {@hide} |
| 476 | */ |
| 477 | public static final int PRIVATE_FLAG_PRIVILEGED = 1<<3; |
| 478 | |
| 479 | /** |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 480 | * Value for {@link #privateFlags}: {@code true} if the application has any IntentFiler |
| 481 | * with some data URI using HTTP or HTTPS with an associated VIEW action. |
Fabrice Di Meglio | d3d8a32 | 2015-04-01 15:58:47 -0700 | [diff] [blame] | 482 | * |
| 483 | * {@hide} |
| 484 | */ |
| 485 | public static final int PRIVATE_FLAG_HAS_DOMAIN_URLS = 1<<4; |
| 486 | |
| 487 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 488 | * When set, the default data storage directory for this app is pointed at |
| 489 | * the device-protected location. |
Jeff Sharkey | 1544779 | 2015-11-05 16:18:51 -0800 | [diff] [blame] | 490 | * |
| 491 | * @hide |
| 492 | */ |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 493 | public static final int PRIVATE_FLAG_DEFAULT_TO_DEVICE_PROTECTED_STORAGE = 1 << 5; |
Jeff Sharkey | 1544779 | 2015-11-05 16:18:51 -0800 | [diff] [blame] | 494 | |
| 495 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 496 | * When set, assume that all components under the given app are direct boot |
Jeff Sharkey | f9fc6d6 | 2015-11-08 16:46:05 -0800 | [diff] [blame] | 497 | * aware, unless otherwise specified. |
| 498 | * |
| 499 | * @hide |
| 500 | */ |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 501 | public static final int PRIVATE_FLAG_DIRECT_BOOT_AWARE = 1 << 6; |
Jeff Sharkey | f9fc6d6 | 2015-11-08 16:46:05 -0800 | [diff] [blame] | 502 | |
| 503 | /** |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 504 | * Value for {@link #privateFlags}: {@code true} if the application is installed |
| 505 | * as instant app. |
| 506 | * |
| 507 | * @hide |
Chad Brubaker | 4389c23 | 2016-11-04 14:50:50 -0700 | [diff] [blame] | 508 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 509 | public static final int PRIVATE_FLAG_INSTANT = 1 << 7; |
Chad Brubaker | 4389c23 | 2016-11-04 14:50:50 -0700 | [diff] [blame] | 510 | |
| 511 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 512 | * When set, at least one component inside this application is direct boot |
| 513 | * aware. |
Jeff Sharkey | 8924e87 | 2015-11-30 12:52:10 -0700 | [diff] [blame] | 514 | * |
| 515 | * @hide |
| 516 | */ |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 517 | public static final int PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE = 1 << 8; |
Jeff Sharkey | 8924e87 | 2015-11-30 12:52:10 -0700 | [diff] [blame] | 518 | |
Fyodor Kupolov | f99104d | 2015-12-14 11:31:29 -0800 | [diff] [blame] | 519 | |
| 520 | /** |
Fyodor Kupolov | bdbc969 | 2015-12-14 13:11:13 -0800 | [diff] [blame] | 521 | * When set, signals that the application is required for the system user and should not be |
| 522 | * uninstalled. |
| 523 | * |
| 524 | * @hide |
| 525 | */ |
Chad Brubaker | 4389c23 | 2016-11-04 14:50:50 -0700 | [diff] [blame] | 526 | public static final int PRIVATE_FLAG_REQUIRED_FOR_SYSTEM_USER = 1 << 9; |
Fyodor Kupolov | bdbc969 | 2015-12-14 13:11:13 -0800 | [diff] [blame] | 527 | |
| 528 | /** |
Wale Ogunwale | e633eb0 | 2017-03-30 12:57:29 -0700 | [diff] [blame] | 529 | * When set, the application explicitly requested that its activities be resizeable by default. |
Wale Ogunwale | 6afdf91 | 2016-01-30 13:01:33 -0800 | [diff] [blame] | 530 | * @see android.R.styleable#AndroidManifestActivity_resizeableActivity |
| 531 | * |
| 532 | * @hide |
| 533 | */ |
Wale Ogunwale | e633eb0 | 2017-03-30 12:57:29 -0700 | [diff] [blame] | 534 | public static final int PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE = 1 << 10; |
| 535 | |
| 536 | /** |
| 537 | * When set, the application explicitly requested that its activities *not* be resizeable by |
| 538 | * default. |
| 539 | * @see android.R.styleable#AndroidManifestActivity_resizeableActivity |
| 540 | * |
| 541 | * @hide |
| 542 | */ |
| 543 | public static final int PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_UNRESIZEABLE = 1 << 11; |
Wale Ogunwale | 72a73e3 | 2016-10-13 12:16:39 -0700 | [diff] [blame] | 544 | |
| 545 | /** |
| 546 | * The application isn't requesting explicitly requesting for its activities to be resizeable or |
| 547 | * non-resizeable by default. So, we are making it activities resizeable by default based on the |
| 548 | * target SDK version of the app. |
| 549 | * @see android.R.styleable#AndroidManifestActivity_resizeableActivity |
| 550 | * |
| 551 | * NOTE: This only affects apps with target SDK >= N where the resizeableActivity attribute was |
| 552 | * introduced. It shouldn't be confused with {@link ActivityInfo#RESIZE_MODE_FORCE_RESIZEABLE} |
| 553 | * where certain pre-N apps are forced to the resizeable. |
| 554 | * |
| 555 | * @hide |
| 556 | */ |
Wale Ogunwale | e633eb0 | 2017-03-30 12:57:29 -0700 | [diff] [blame] | 557 | public static final int PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION = |
| 558 | 1 << 12; |
Wale Ogunwale | 6afdf91 | 2016-01-30 13:01:33 -0800 | [diff] [blame] | 559 | |
| 560 | /** |
Christopher Tate | 43fbc5f | 2016-02-17 18:00:48 -0800 | [diff] [blame] | 561 | * Value for {@link #privateFlags}: {@code true} means the OS should go ahead and |
| 562 | * run full-data backup operations for the app even when it is in a |
| 563 | * foreground-equivalent run state. Defaults to {@code false} if unspecified. |
| 564 | * @hide |
| 565 | */ |
Wale Ogunwale | e633eb0 | 2017-03-30 12:57:29 -0700 | [diff] [blame] | 566 | public static final int PRIVATE_FLAG_BACKUP_IN_FOREGROUND = 1 << 13; |
Christopher Tate | 43fbc5f | 2016-02-17 18:00:48 -0800 | [diff] [blame] | 567 | |
| 568 | /** |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 569 | * Value for {@link #privateFlags}: {@code true} means this application |
| 570 | * contains a static shared library. Defaults to {@code false} if unspecified. |
| 571 | * @hide |
| 572 | */ |
Wale Ogunwale | e633eb0 | 2017-03-30 12:57:29 -0700 | [diff] [blame] | 573 | public static final int PRIVATE_FLAG_STATIC_SHARED_LIBRARY = 1 << 14; |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 574 | |
| 575 | /** |
Todd Kennedy | 5eb5a7d | 2017-08-01 07:42:47 -0700 | [diff] [blame] | 576 | * Value for {@link #privateFlags}: When set, the application will only have its splits loaded |
Adam Lesinski | 4e86281 | 2016-11-21 16:02:24 -0800 | [diff] [blame] | 577 | * if they are required to load a component. Splits can be loaded on demand using the |
| 578 | * {@link Context#createContextForSplit(String)} API. |
| 579 | * @hide |
| 580 | */ |
Wale Ogunwale | e633eb0 | 2017-03-30 12:57:29 -0700 | [diff] [blame] | 581 | public static final int PRIVATE_FLAG_ISOLATED_SPLIT_LOADING = 1 << 15; |
Adam Lesinski | 4e86281 | 2016-11-21 16:02:24 -0800 | [diff] [blame] | 582 | |
| 583 | /** |
Todd Kennedy | 5eb5a7d | 2017-08-01 07:42:47 -0700 | [diff] [blame] | 584 | * Value for {@link #privateFlags}: When set, the application was installed as |
| 585 | * a virtual preload. |
| 586 | * @hide |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 587 | */ |
Todd Kennedy | 5eb5a7d | 2017-08-01 07:42:47 -0700 | [diff] [blame] | 588 | public static final int PRIVATE_FLAG_VIRTUAL_PRELOAD = 1 << 16; |
| 589 | |
Svet Ganov | 087dce2 | 2017-09-07 15:42:16 -0700 | [diff] [blame] | 590 | /** |
| 591 | * Value for {@linl #privateFlags}: whether this app is pre-installed on the |
| 592 | * OEM partition of the system image. |
| 593 | * @hide |
| 594 | */ |
| 595 | public static final int PRIVATE_FLAG_OEM = 1 << 17; |
| 596 | |
Todd Kennedy | 5eb5a7d | 2017-08-01 07:42:47 -0700 | [diff] [blame] | 597 | /** @hide */ |
| 598 | @IntDef(flag = true, prefix = { "PRIVATE_FLAG_" }, value = { |
Svet Ganov | 087dce2 | 2017-09-07 15:42:16 -0700 | [diff] [blame] | 599 | PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE, |
| 600 | PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION, |
| 601 | PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_UNRESIZEABLE, |
| 602 | PRIVATE_FLAG_BACKUP_IN_FOREGROUND, |
Todd Kennedy | 5eb5a7d | 2017-08-01 07:42:47 -0700 | [diff] [blame] | 603 | PRIVATE_FLAG_CANT_SAVE_STATE, |
Todd Kennedy | 5eb5a7d | 2017-08-01 07:42:47 -0700 | [diff] [blame] | 604 | PRIVATE_FLAG_DEFAULT_TO_DEVICE_PROTECTED_STORAGE, |
| 605 | PRIVATE_FLAG_DIRECT_BOOT_AWARE, |
Svet Ganov | 087dce2 | 2017-09-07 15:42:16 -0700 | [diff] [blame] | 606 | PRIVATE_FLAG_FORWARD_LOCK, |
| 607 | PRIVATE_FLAG_HAS_DOMAIN_URLS, |
| 608 | PRIVATE_FLAG_HIDDEN, |
Todd Kennedy | 5eb5a7d | 2017-08-01 07:42:47 -0700 | [diff] [blame] | 609 | PRIVATE_FLAG_INSTANT, |
Todd Kennedy | 5eb5a7d | 2017-08-01 07:42:47 -0700 | [diff] [blame] | 610 | PRIVATE_FLAG_ISOLATED_SPLIT_LOADING, |
Svet Ganov | 087dce2 | 2017-09-07 15:42:16 -0700 | [diff] [blame] | 611 | PRIVATE_FLAG_OEM, |
| 612 | PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE, |
| 613 | PRIVATE_FLAG_PRIVILEGED, |
| 614 | PRIVATE_FLAG_REQUIRED_FOR_SYSTEM_USER, |
| 615 | PRIVATE_FLAG_STATIC_SHARED_LIBRARY, |
Todd Kennedy | 5eb5a7d | 2017-08-01 07:42:47 -0700 | [diff] [blame] | 616 | PRIVATE_FLAG_VIRTUAL_PRELOAD, |
| 617 | }) |
| 618 | @Retention(RetentionPolicy.SOURCE) |
| 619 | public @interface ApplicationInfoPrivateFlags {} |
| 620 | |
| 621 | /** |
| 622 | * Private/hidden flags. See {@code PRIVATE_FLAG_...} constants. |
| 623 | * @hide |
| 624 | */ |
| 625 | public @ApplicationInfoPrivateFlags int privateFlags; |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 626 | |
| 627 | /** |
Clara Bayarri | 4b5a4d2 | 2017-01-27 20:15:45 +0000 | [diff] [blame] | 628 | * @hide |
| 629 | */ |
| 630 | public static final String METADATA_PRELOADED_FONTS = "preloaded_fonts"; |
| 631 | |
| 632 | /** |
Dianne Hackborn | df6e980 | 2011-05-26 14:20:23 -0700 | [diff] [blame] | 633 | * The required smallest screen width the application can run on. If 0, |
| 634 | * nothing has been specified. Comes from |
| 635 | * {@link android.R.styleable#AndroidManifestSupportsScreens_requiresSmallestWidthDp |
| 636 | * android:requiresSmallestWidthDp} attribute of the <supports-screens> tag. |
| 637 | */ |
| 638 | public int requiresSmallestWidthDp = 0; |
| 639 | |
| 640 | /** |
| 641 | * The maximum smallest screen width the application is designed for. If 0, |
| 642 | * nothing has been specified. Comes from |
| 643 | * {@link android.R.styleable#AndroidManifestSupportsScreens_compatibleWidthLimitDp |
| 644 | * android:compatibleWidthLimitDp} attribute of the <supports-screens> tag. |
| 645 | */ |
| 646 | public int compatibleWidthLimitDp = 0; |
| 647 | |
| 648 | /** |
Dianne Hackborn | 2762ff3 | 2011-06-01 21:27:05 -0700 | [diff] [blame] | 649 | * The maximum smallest screen width the application will work on. If 0, |
| 650 | * nothing has been specified. Comes from |
| 651 | * {@link android.R.styleable#AndroidManifestSupportsScreens_largestWidthLimitDp |
| 652 | * android:largestWidthLimitDp} attribute of the <supports-screens> tag. |
| 653 | */ |
| 654 | public int largestWidthLimitDp = 0; |
| 655 | |
Jeff Sharkey | 6112860 | 2017-01-26 17:07:35 -0700 | [diff] [blame] | 656 | /** |
Wale Ogunwale | 55ddf8f | 2017-03-20 08:56:38 -0700 | [diff] [blame] | 657 | * Value indicating the maximum aspect ratio the application supports. |
| 658 | * <p> |
| 659 | * 0 means unset. |
| 660 | * @See {@link android.R.attr#maxAspectRatio}. |
| 661 | * @hide |
| 662 | */ |
| 663 | public float maxAspectRatio; |
| 664 | |
Jeff Sharkey | 789a8fc | 2017-04-16 13:18:35 -0600 | [diff] [blame] | 665 | /** @removed */ |
| 666 | @Deprecated |
| 667 | public String volumeUuid; |
| 668 | |
Wale Ogunwale | 55ddf8f | 2017-03-20 08:56:38 -0700 | [diff] [blame] | 669 | /** |
Jeff Sharkey | 6112860 | 2017-01-26 17:07:35 -0700 | [diff] [blame] | 670 | * UUID of the storage volume on which this application is being hosted. For |
| 671 | * apps hosted on the default internal storage at |
Jeff Sharkey | 789a8fc | 2017-04-16 13:18:35 -0600 | [diff] [blame] | 672 | * {@link Environment#getDataDirectory()}, the UUID value is |
| 673 | * {@link StorageManager#UUID_DEFAULT}. |
Jeff Sharkey | 6112860 | 2017-01-26 17:07:35 -0700 | [diff] [blame] | 674 | */ |
Jeff Sharkey | 789a8fc | 2017-04-16 13:18:35 -0600 | [diff] [blame] | 675 | public UUID storageUuid; |
Jeff Sharkey | 6112860 | 2017-01-26 17:07:35 -0700 | [diff] [blame] | 676 | |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 677 | /** {@hide} */ |
Jeff Sharkey | d746057 | 2014-07-06 20:44:55 -0700 | [diff] [blame] | 678 | public String scanSourceDir; |
| 679 | /** {@hide} */ |
| 680 | public String scanPublicSourceDir; |
| 681 | |
Dianne Hackborn | 2762ff3 | 2011-06-01 21:27:05 -0700 | [diff] [blame] | 682 | /** |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 683 | * Full path to the base APK for this application. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 684 | */ |
| 685 | public String sourceDir; |
| 686 | |
| 687 | /** |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 688 | * Full path to the publicly available parts of {@link #sourceDir}, |
| 689 | * including resources and manifest. This may be different from |
| 690 | * {@link #sourceDir} if an application is forward locked. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 691 | */ |
| 692 | public String publicSourceDir; |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 693 | |
| 694 | /** |
Adam Lesinski | 4e86281 | 2016-11-21 16:02:24 -0800 | [diff] [blame] | 695 | * The names of all installed split APKs, ordered lexicographically. |
| 696 | */ |
| 697 | public String[] splitNames; |
| 698 | |
| 699 | /** |
| 700 | * Full paths to zero or more split APKs, indexed by the same order as {@link #splitNames}. |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 701 | */ |
| 702 | public String[] splitSourceDirs; |
| 703 | |
| 704 | /** |
| 705 | * Full path to the publicly available parts of {@link #splitSourceDirs}, |
| 706 | * including resources and manifest. This may be different from |
| 707 | * {@link #splitSourceDirs} if an application is forward locked. |
Adam Lesinski | 4e86281 | 2016-11-21 16:02:24 -0800 | [diff] [blame] | 708 | * |
| 709 | * @see #splitSourceDirs |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 710 | */ |
| 711 | public String[] splitPublicSourceDirs; |
| 712 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 713 | /** |
Adam Lesinski | 4e86281 | 2016-11-21 16:02:24 -0800 | [diff] [blame] | 714 | * Maps the dependencies between split APKs. All splits implicitly depend on the base APK. |
| 715 | * |
| 716 | * Available since platform version O. |
| 717 | * |
| 718 | * Only populated if the application opts in to isolated split loading via the |
| 719 | * {@link android.R.attr.isolatedSplits} attribute in the <manifest> tag of the app's |
| 720 | * AndroidManifest.xml. |
| 721 | * |
| 722 | * The keys and values are all indices into the {@link #splitNames}, {@link #splitSourceDirs}, |
| 723 | * and {@link #splitPublicSourceDirs} arrays. |
Adam Lesinski | 1665d0f | 2017-03-10 14:46:57 -0800 | [diff] [blame] | 724 | * Each key represents a split and its value is an array of splits. The first element of this |
| 725 | * array is the parent split, and the rest are configuration splits. These configuration splits |
| 726 | * have no dependencies themselves. |
Adam Lesinski | 4e86281 | 2016-11-21 16:02:24 -0800 | [diff] [blame] | 727 | * Cycles do not exist because they are illegal and screened for during installation. |
| 728 | * |
| 729 | * May be null if no splits are installed, or if no dependencies exist between them. |
Calin Juravle | da09815 | 2017-09-01 17:30:01 -0700 | [diff] [blame] | 730 | * |
| 731 | * NOTE: Any change to the way split dependencies are stored must update the logic that |
| 732 | * creates the class loader context for dexopt (DexoptUtils#getClassLoaderContexts). |
| 733 | * |
Adam Lesinski | 4e86281 | 2016-11-21 16:02:24 -0800 | [diff] [blame] | 734 | * @hide |
| 735 | */ |
Adam Lesinski | 1665d0f | 2017-03-10 14:46:57 -0800 | [diff] [blame] | 736 | public SparseArray<int[]> splitDependencies; |
Adam Lesinski | 4e86281 | 2016-11-21 16:02:24 -0800 | [diff] [blame] | 737 | |
| 738 | /** |
| 739 | * Full paths to the locations of extra resource packages (runtime overlays) |
| 740 | * this application uses. This field is only used if there are extra resource |
| 741 | * packages, otherwise it is null. |
| 742 | * |
Kenny Root | ace5a3f | 2010-02-05 12:59:28 -0800 | [diff] [blame] | 743 | * {@hide} |
Kenny Root | d1ab016 | 2010-01-21 17:27:14 -0800 | [diff] [blame] | 744 | */ |
| 745 | public String[] resourceDirs; |
| 746 | |
| 747 | /** |
Robert Craig | 0f40dc9 | 2013-03-25 06:33:03 -0400 | [diff] [blame] | 748 | * String retrieved from the seinfo tag found in selinux policy. This value |
Robert Craig | 5e16bc5 | 2015-08-28 12:11:41 -0400 | [diff] [blame] | 749 | * can be overridden with a value set through the mac_permissions.xml policy |
| 750 | * construct. This value is useful in setting an SELinux security context on |
| 751 | * the process as well as its data directory. The String default is being used |
| 752 | * here to represent a catchall label when no policy matches. |
Robert Craig | 0f40dc9 | 2013-03-25 06:33:03 -0400 | [diff] [blame] | 753 | * |
| 754 | * {@hide} |
| 755 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 756 | public String seInfo = "default"; |
| 757 | |
| 758 | /** |
| 759 | * The seinfo tag generated per-user. This value may change based upon the |
| 760 | * user's configuration. For example, when an instant app is installed for |
| 761 | * a user. It is an error if this field is ever {@code null} when trying to |
| 762 | * start a new process. |
| 763 | * <p>NOTE: We need to separate this out because we modify per-user values |
| 764 | * multiple times. This needs to be refactored since we're performing more |
| 765 | * work than necessary and these values should only be set once. When that |
| 766 | * happens, we can merge the per-user value with the seInfo state above. |
| 767 | * |
| 768 | * {@hide} |
| 769 | */ |
| 770 | public String seInfoUser; |
Robert Craig | 0f40dc9 | 2013-03-25 06:33:03 -0400 | [diff] [blame] | 771 | |
| 772 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 773 | * Paths to all shared libraries this application is linked against. This |
| 774 | * field is only set if the {@link PackageManager#GET_SHARED_LIBRARY_FILES |
| 775 | * PackageManager.GET_SHARED_LIBRARY_FILES} flag was used when retrieving |
| 776 | * the structure. |
| 777 | */ |
| 778 | public String[] sharedLibraryFiles; |
| 779 | |
| 780 | /** |
Jeff Sharkey | 7a30a30 | 2015-12-08 14:20:06 -0700 | [diff] [blame] | 781 | * Full path to the default directory assigned to the package for its |
| 782 | * persistent data. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 783 | */ |
| 784 | public String dataDir; |
Kenny Root | 85387d7 | 2010-08-26 10:13:11 -0700 | [diff] [blame] | 785 | |
Jeff Sharkey | 7a30a30 | 2015-12-08 14:20:06 -0700 | [diff] [blame] | 786 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 787 | * Full path to the device-protected directory assigned to the package for |
Jeff Sharkey | 7a30a30 | 2015-12-08 14:20:06 -0700 | [diff] [blame] | 788 | * its persistent data. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 789 | * |
| 790 | * @see Context#createDeviceProtectedStorageContext() |
Jeff Sharkey | 7a30a30 | 2015-12-08 14:20:06 -0700 | [diff] [blame] | 791 | */ |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 792 | public String deviceProtectedDataDir; |
| 793 | |
Jeff Sharkey | 7a30a30 | 2015-12-08 14:20:06 -0700 | [diff] [blame] | 794 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 795 | * Full path to the credential-protected directory assigned to the package |
Jeff Sharkey | 7a30a30 | 2015-12-08 14:20:06 -0700 | [diff] [blame] | 796 | * for its persistent data. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 797 | * |
| 798 | * @hide |
Jeff Sharkey | 7a30a30 | 2015-12-08 14:20:06 -0700 | [diff] [blame] | 799 | */ |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 800 | @SystemApi |
| 801 | public String credentialProtectedDataDir; |
| 802 | |
Kenny Root | 85387d7 | 2010-08-26 10:13:11 -0700 | [diff] [blame] | 803 | /** |
| 804 | * Full path to the directory where native JNI libraries are stored. |
Kenny Root | 85387d7 | 2010-08-26 10:13:11 -0700 | [diff] [blame] | 805 | */ |
| 806 | public String nativeLibraryDir; |
| 807 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 808 | /** |
Narayan Kamath | 7dba6eb | 2014-07-16 08:53:30 +0100 | [diff] [blame] | 809 | * Full path where unpacked native libraries for {@link #secondaryCpuAbi} |
| 810 | * are stored, if present. |
| 811 | * |
| 812 | * The main reason this exists is for bundled multi-arch apps, where |
| 813 | * it's not trivial to calculate the location of libs for the secondary abi |
| 814 | * given the location of the primary. |
| 815 | * |
| 816 | * TODO: Change the layout of bundled installs so that we can use |
| 817 | * nativeLibraryRootDir & nativeLibraryRootRequiresIsa there as well. |
| 818 | * (e.g {@code [ "/system/app-lib/Foo/arm", "/system/app-lib/Foo/arm64" ]} |
| 819 | * instead of {@code [ "/system/lib/Foo", "/system/lib64/Foo" ]}. |
| 820 | * |
| 821 | * @hide |
| 822 | */ |
| 823 | public String secondaryNativeLibraryDir; |
| 824 | |
| 825 | /** |
Jeff Sharkey | 84f1294 | 2014-07-10 17:48:11 -0700 | [diff] [blame] | 826 | * The root path where unpacked native libraries are stored. |
| 827 | * <p> |
| 828 | * When {@link #nativeLibraryRootRequiresIsa} is set, the libraries are |
| 829 | * placed in ISA-specific subdirectories under this path, otherwise the |
| 830 | * libraries are placed directly at this path. |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 831 | * |
Jeff Sharkey | 84f1294 | 2014-07-10 17:48:11 -0700 | [diff] [blame] | 832 | * @hide |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 833 | */ |
Jeff Sharkey | 84f1294 | 2014-07-10 17:48:11 -0700 | [diff] [blame] | 834 | public String nativeLibraryRootDir; |
| 835 | |
| 836 | /** |
| 837 | * Flag indicating that ISA must be appended to |
| 838 | * {@link #nativeLibraryRootDir} to be useful. |
| 839 | * |
| 840 | * @hide |
| 841 | */ |
| 842 | public boolean nativeLibraryRootRequiresIsa; |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 843 | |
| 844 | /** |
| 845 | * 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] | 846 | * of the native JNI libraries the application bundles. Will be {@code null} |
| 847 | * if this application does not require any particular ABI. |
| 848 | * |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 849 | * If non-null, the application will always be launched with this ABI. |
| 850 | * |
Ramin Zaghi | ff0c470 | 2014-04-01 15:02:29 +0100 | [diff] [blame] | 851 | * {@hide} |
| 852 | */ |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 853 | public String primaryCpuAbi; |
| 854 | |
| 855 | /** |
| 856 | * The secondary ABI for this application. Might be non-null for multi-arch |
| 857 | * installs. The application itself never uses this ABI, but other applications that |
| 858 | * use its code might. |
| 859 | * |
| 860 | * {@hide} |
| 861 | */ |
| 862 | public String secondaryCpuAbi; |
| 863 | |
| 864 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 865 | * The kernel user-ID that has been assigned to this application; |
| 866 | * currently this is not a unique ID (multiple applications can have |
| 867 | * the same uid). |
| 868 | */ |
| 869 | public int uid; |
| 870 | |
Mitsuru Oshima | 8d11267 | 2009-04-27 12:01:23 -0700 | [diff] [blame] | 871 | /** |
Todd Kennedy | 89d6018 | 2016-03-11 11:18:32 -0800 | [diff] [blame] | 872 | * The minimum SDK version this application can run on. It will not run |
| 873 | * on earlier versions. |
| 874 | */ |
Todd Kennedy | 6e2e7f5 | 2016-05-02 14:56:45 -0700 | [diff] [blame] | 875 | public int minSdkVersion; |
Todd Kennedy | 89d6018 | 2016-03-11 11:18:32 -0800 | [diff] [blame] | 876 | |
| 877 | /** |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 878 | * The minimum SDK version this application targets. It may run on earlier |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 879 | * versions, but it knows how to work with any new behavior added at this |
| 880 | * version. Will be {@link android.os.Build.VERSION_CODES#CUR_DEVELOPMENT} |
| 881 | * if this is a development build and the app is targeting that. You should |
| 882 | * compare that this number is >= the SDK version number at which your |
| 883 | * behavior was introduced. |
| 884 | */ |
| 885 | public int targetSdkVersion; |
Dianne Hackborn | 8472e61 | 2014-01-23 17:57:20 -0800 | [diff] [blame] | 886 | |
| 887 | /** |
| 888 | * The app's declared version code. |
| 889 | * @hide |
| 890 | */ |
| 891 | public int versionCode; |
| 892 | |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 893 | /** |
Alan Viverette | b6a2573 | 2017-11-21 14:49:24 -0500 | [diff] [blame^] | 894 | * The user-visible SDK version (ex. 26) of the framework against which the application claims |
| 895 | * to have been compiled, or {@code 0} if not specified. |
| 896 | * <p> |
| 897 | * This property is the compile-time equivalent of |
| 898 | * {@link android.os.Build.VERSION#CODENAME Build.VERSION.SDK_INT}. |
| 899 | * |
| 900 | * @hide For platform use only; we don't expect developers to need to read this value. |
| 901 | */ |
| 902 | public int compileSdkVersion; |
| 903 | |
| 904 | /** |
| 905 | * The development codename (ex. "O", "REL") of the framework against which the application |
| 906 | * claims to have been compiled, or {@code null} if not specified. |
| 907 | * <p> |
| 908 | * This property is the compile-time equivalent of |
| 909 | * {@link android.os.Build.VERSION#CODENAME Build.VERSION.CODENAME}. |
| 910 | * |
| 911 | * @hide For platform use only; we don't expect developers to need to read this value. |
| 912 | */ |
| 913 | @Nullable |
| 914 | public String compileSdkVersionCodename; |
| 915 | |
| 916 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 917 | * When false, indicates that all components within this application are |
| 918 | * considered disabled, regardless of their individually set enabled status. |
| 919 | */ |
| 920 | public boolean enabled = true; |
| 921 | |
Dianne Hackborn | 54e570f | 2010-10-04 18:32:32 -0700 | [diff] [blame] | 922 | /** |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 923 | * For convenient access to the current enabled setting of this app. |
| 924 | * @hide |
| 925 | */ |
| 926 | public int enabledSetting = PackageManager.COMPONENT_ENABLED_STATE_DEFAULT; |
| 927 | |
| 928 | /** |
Dianne Hackborn | 54e570f | 2010-10-04 18:32:32 -0700 | [diff] [blame] | 929 | * For convenient access to package's install location. |
| 930 | * @hide |
| 931 | */ |
| 932 | public int installLocation = PackageInfo.INSTALL_LOCATION_UNSPECIFIED; |
Jose Lima | 12d0b4c | 2014-03-14 16:55:12 -0700 | [diff] [blame] | 933 | |
Chad Brubaker | c845b2a | 2016-05-13 14:09:27 -0700 | [diff] [blame] | 934 | /** |
| 935 | * Resource file providing the application's Network Security Config. |
| 936 | * @hide |
| 937 | */ |
| 938 | public int networkSecurityConfigRes; |
| 939 | |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 940 | /** |
Todd Kennedy | 11e4507 | 2017-01-25 13:24:21 -0800 | [diff] [blame] | 941 | * Version of the sandbox the application wants to run in. |
| 942 | * @hide |
| 943 | */ |
| 944 | public int targetSandboxVersion; |
| 945 | |
| 946 | /** |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 947 | * The category of this app. Categories are used to cluster multiple apps |
| 948 | * together into meaningful groups, such as when summarizing battery, |
| 949 | * network, or disk usage. Apps should only define this value when they fit |
| 950 | * well into one of the specific categories. |
| 951 | * <p> |
| 952 | * Set from the {@link android.R.attr#appCategory} attribute in the |
| 953 | * manifest. If the manifest doesn't define a category, this value may have |
| 954 | * been provided by the installer via |
| 955 | * {@link PackageManager#setApplicationCategoryHint(String, int)}. |
| 956 | */ |
| 957 | public @Category int category = CATEGORY_UNDEFINED; |
| 958 | |
| 959 | /** {@hide} */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 960 | @IntDef(prefix = { "CATEGORY_" }, value = { |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 961 | CATEGORY_UNDEFINED, |
| 962 | CATEGORY_GAME, |
| 963 | CATEGORY_AUDIO, |
| 964 | CATEGORY_VIDEO, |
| 965 | CATEGORY_IMAGE, |
| 966 | CATEGORY_SOCIAL, |
| 967 | CATEGORY_NEWS, |
| 968 | CATEGORY_MAPS, |
| 969 | CATEGORY_PRODUCTIVITY |
| 970 | }) |
| 971 | @Retention(RetentionPolicy.SOURCE) |
| 972 | public @interface Category { |
| 973 | } |
| 974 | |
| 975 | /** |
| 976 | * Value when category is undefined. |
| 977 | * |
| 978 | * @see #category |
| 979 | */ |
| 980 | public static final int CATEGORY_UNDEFINED = -1; |
| 981 | |
| 982 | /** |
| 983 | * Category for apps which are primarily games. |
| 984 | * |
| 985 | * @see #category |
| 986 | */ |
| 987 | public static final int CATEGORY_GAME = 0; |
| 988 | |
| 989 | /** |
| 990 | * Category for apps which primarily work with audio or music, such as music |
| 991 | * players. |
| 992 | * |
| 993 | * @see #category |
| 994 | */ |
| 995 | public static final int CATEGORY_AUDIO = 1; |
| 996 | |
| 997 | /** |
| 998 | * Category for apps which primarily work with video or movies, such as |
| 999 | * streaming video apps. |
| 1000 | * |
| 1001 | * @see #category |
| 1002 | */ |
| 1003 | public static final int CATEGORY_VIDEO = 2; |
| 1004 | |
| 1005 | /** |
| 1006 | * Category for apps which primarily work with images or photos, such as |
| 1007 | * camera or gallery apps. |
| 1008 | * |
| 1009 | * @see #category |
| 1010 | */ |
| 1011 | public static final int CATEGORY_IMAGE = 3; |
| 1012 | |
| 1013 | /** |
| 1014 | * Category for apps which are primarily social apps, such as messaging, |
Jeff Sharkey | d2b6910 | 2017-03-21 19:40:38 -0600 | [diff] [blame] | 1015 | * communication, email, or social network apps. |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 1016 | * |
| 1017 | * @see #category |
| 1018 | */ |
| 1019 | public static final int CATEGORY_SOCIAL = 4; |
| 1020 | |
| 1021 | /** |
| 1022 | * Category for apps which are primarily news apps, such as newspapers, |
| 1023 | * magazines, or sports apps. |
| 1024 | * |
| 1025 | * @see #category |
| 1026 | */ |
| 1027 | public static final int CATEGORY_NEWS = 5; |
| 1028 | |
| 1029 | /** |
| 1030 | * Category for apps which are primarily maps apps, such as navigation apps. |
| 1031 | * |
| 1032 | * @see #category |
| 1033 | */ |
| 1034 | public static final int CATEGORY_MAPS = 6; |
| 1035 | |
| 1036 | /** |
| 1037 | * Category for apps which are primarily productivity apps, such as cloud |
| 1038 | * storage or workplace apps. |
| 1039 | * |
| 1040 | * @see #category |
| 1041 | */ |
| 1042 | public static final int CATEGORY_PRODUCTIVITY = 7; |
| 1043 | |
| 1044 | /** |
| 1045 | * Return a concise, localized title for the given |
| 1046 | * {@link ApplicationInfo#category} value, or {@code null} for unknown |
| 1047 | * values such as {@link #CATEGORY_UNDEFINED}. |
| 1048 | * |
| 1049 | * @see #category |
| 1050 | */ |
| 1051 | public static CharSequence getCategoryTitle(Context context, @Category int category) { |
| 1052 | switch (category) { |
| 1053 | case ApplicationInfo.CATEGORY_GAME: |
| 1054 | return context.getText(com.android.internal.R.string.app_category_game); |
| 1055 | case ApplicationInfo.CATEGORY_AUDIO: |
| 1056 | return context.getText(com.android.internal.R.string.app_category_audio); |
| 1057 | case ApplicationInfo.CATEGORY_VIDEO: |
| 1058 | return context.getText(com.android.internal.R.string.app_category_video); |
| 1059 | case ApplicationInfo.CATEGORY_IMAGE: |
| 1060 | return context.getText(com.android.internal.R.string.app_category_image); |
| 1061 | case ApplicationInfo.CATEGORY_SOCIAL: |
| 1062 | return context.getText(com.android.internal.R.string.app_category_social); |
| 1063 | case ApplicationInfo.CATEGORY_NEWS: |
| 1064 | return context.getText(com.android.internal.R.string.app_category_news); |
| 1065 | case ApplicationInfo.CATEGORY_MAPS: |
| 1066 | return context.getText(com.android.internal.R.string.app_category_maps); |
| 1067 | case ApplicationInfo.CATEGORY_PRODUCTIVITY: |
| 1068 | return context.getText(com.android.internal.R.string.app_category_productivity); |
| 1069 | default: |
| 1070 | return null; |
| 1071 | } |
| 1072 | } |
| 1073 | |
Narayan Kamath | f9419f0 | 2017-06-15 11:35:38 +0100 | [diff] [blame] | 1074 | /** @hide */ |
| 1075 | public String classLoaderName; |
| 1076 | |
| 1077 | /** @hide */ |
| 1078 | public String[] splitClassLoaderNames; |
| 1079 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1080 | public void dump(Printer pw, String prefix) { |
Dianne Hackborn | 6ac42ae | 2015-12-08 17:22:10 -0800 | [diff] [blame] | 1081 | dump(pw, prefix, DUMP_FLAG_ALL); |
| 1082 | } |
| 1083 | |
| 1084 | /** @hide */ |
Yohei Yukawa | 8f27217 | 2017-08-31 00:26:01 -0700 | [diff] [blame] | 1085 | public void dump(Printer pw, String prefix, int dumpFlags) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1086 | super.dumpFront(pw, prefix); |
Yohei Yukawa | 8f27217 | 2017-08-31 00:26:01 -0700 | [diff] [blame] | 1087 | if ((dumpFlags & DUMP_FLAG_DETAILS) != 0 && className != null) { |
Dianne Hackborn | 12527f9 | 2009-11-11 17:39:50 -0800 | [diff] [blame] | 1088 | pw.println(prefix + "className=" + className); |
| 1089 | } |
| 1090 | if (permission != null) { |
| 1091 | pw.println(prefix + "permission=" + permission); |
| 1092 | } |
Dianne Hackborn | 39792d2 | 2010-08-19 18:01:52 -0700 | [diff] [blame] | 1093 | pw.println(prefix + "processName=" + processName); |
Yohei Yukawa | 8f27217 | 2017-08-31 00:26:01 -0700 | [diff] [blame] | 1094 | if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) { |
Dianne Hackborn | 6ac42ae | 2015-12-08 17:22:10 -0800 | [diff] [blame] | 1095 | pw.println(prefix + "taskAffinity=" + taskAffinity); |
| 1096 | } |
Dianne Hackborn | 39792d2 | 2010-08-19 18:01:52 -0700 | [diff] [blame] | 1097 | pw.println(prefix + "uid=" + uid + " flags=0x" + Integer.toHexString(flags) |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 1098 | + " privateFlags=0x" + Integer.toHexString(privateFlags) |
Dianne Hackborn | 39792d2 | 2010-08-19 18:01:52 -0700 | [diff] [blame] | 1099 | + " theme=0x" + Integer.toHexString(theme)); |
Yohei Yukawa | 8f27217 | 2017-08-31 00:26:01 -0700 | [diff] [blame] | 1100 | if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) { |
Dianne Hackborn | 6ac42ae | 2015-12-08 17:22:10 -0800 | [diff] [blame] | 1101 | pw.println(prefix + "requiresSmallestWidthDp=" + requiresSmallestWidthDp |
| 1102 | + " compatibleWidthLimitDp=" + compatibleWidthLimitDp |
| 1103 | + " largestWidthLimitDp=" + largestWidthLimitDp); |
| 1104 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1105 | pw.println(prefix + "sourceDir=" + sourceDir); |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 1106 | if (!Objects.equals(sourceDir, publicSourceDir)) { |
Dianne Hackborn | 39792d2 | 2010-08-19 18:01:52 -0700 | [diff] [blame] | 1107 | pw.println(prefix + "publicSourceDir=" + publicSourceDir); |
| 1108 | } |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 1109 | if (!ArrayUtils.isEmpty(splitSourceDirs)) { |
| 1110 | pw.println(prefix + "splitSourceDirs=" + Arrays.toString(splitSourceDirs)); |
| 1111 | } |
| 1112 | if (!ArrayUtils.isEmpty(splitPublicSourceDirs) |
| 1113 | && !Arrays.equals(splitSourceDirs, splitPublicSourceDirs)) { |
| 1114 | pw.println(prefix + "splitPublicSourceDirs=" + Arrays.toString(splitPublicSourceDirs)); |
| 1115 | } |
Dianne Hackborn | 39792d2 | 2010-08-19 18:01:52 -0700 | [diff] [blame] | 1116 | if (resourceDirs != null) { |
Andreas Gampe | e6748ce | 2015-12-11 18:00:38 -0800 | [diff] [blame] | 1117 | pw.println(prefix + "resourceDirs=" + Arrays.toString(resourceDirs)); |
Dianne Hackborn | 39792d2 | 2010-08-19 18:01:52 -0700 | [diff] [blame] | 1118 | } |
Yohei Yukawa | 8f27217 | 2017-08-31 00:26:01 -0700 | [diff] [blame] | 1119 | if ((dumpFlags & DUMP_FLAG_DETAILS) != 0 && seInfo != null) { |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 1120 | pw.println(prefix + "seinfo=" + seInfo); |
| 1121 | pw.println(prefix + "seinfoUser=" + seInfoUser); |
Robert Craig | 0f40dc9 | 2013-03-25 06:33:03 -0400 | [diff] [blame] | 1122 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1123 | pw.println(prefix + "dataDir=" + dataDir); |
Yohei Yukawa | 8f27217 | 2017-08-31 00:26:01 -0700 | [diff] [blame] | 1124 | if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) { |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 1125 | pw.println(prefix + "deviceProtectedDataDir=" + deviceProtectedDataDir); |
| 1126 | pw.println(prefix + "credentialProtectedDataDir=" + credentialProtectedDataDir); |
Dianne Hackborn | 6ac42ae | 2015-12-08 17:22:10 -0800 | [diff] [blame] | 1127 | if (sharedLibraryFiles != null) { |
| 1128 | pw.println(prefix + "sharedLibraryFiles=" + Arrays.toString(sharedLibraryFiles)); |
| 1129 | } |
Dianne Hackborn | 12527f9 | 2009-11-11 17:39:50 -0800 | [diff] [blame] | 1130 | } |
Narayan Kamath | f9419f0 | 2017-06-15 11:35:38 +0100 | [diff] [blame] | 1131 | if (classLoaderName != null) { |
| 1132 | pw.println(prefix + "classLoaderName=" + classLoaderName); |
| 1133 | } |
| 1134 | if (!ArrayUtils.isEmpty(splitClassLoaderNames)) { |
| 1135 | pw.println(prefix + "splitClassLoaderNames=" + Arrays.toString(splitClassLoaderNames)); |
| 1136 | } |
| 1137 | |
Todd Kennedy | 89d6018 | 2016-03-11 11:18:32 -0800 | [diff] [blame] | 1138 | pw.println(prefix + "enabled=" + enabled |
| 1139 | + " minSdkVersion=" + minSdkVersion |
| 1140 | + " targetSdkVersion=" + targetSdkVersion |
Todd Kennedy | 11e4507 | 2017-01-25 13:24:21 -0800 | [diff] [blame] | 1141 | + " versionCode=" + versionCode |
| 1142 | + " targetSandboxVersion=" + targetSandboxVersion); |
Yohei Yukawa | 8f27217 | 2017-08-31 00:26:01 -0700 | [diff] [blame] | 1143 | if ((dumpFlags & DUMP_FLAG_DETAILS) != 0) { |
Dianne Hackborn | 6ac42ae | 2015-12-08 17:22:10 -0800 | [diff] [blame] | 1144 | if (manageSpaceActivityName != null) { |
| 1145 | pw.println(prefix + "manageSpaceActivityName=" + manageSpaceActivityName); |
| 1146 | } |
| 1147 | if (descriptionRes != 0) { |
| 1148 | pw.println(prefix + "description=0x" + Integer.toHexString(descriptionRes)); |
| 1149 | } |
| 1150 | if (uiOptions != 0) { |
| 1151 | pw.println(prefix + "uiOptions=0x" + Integer.toHexString(uiOptions)); |
| 1152 | } |
| 1153 | pw.println(prefix + "supportsRtl=" + (hasRtlSupport() ? "true" : "false")); |
| 1154 | if (fullBackupContent > 0) { |
| 1155 | pw.println(prefix + "fullBackupContent=@xml/" + fullBackupContent); |
| 1156 | } else { |
| 1157 | pw.println(prefix + "fullBackupContent=" |
| 1158 | + (fullBackupContent < 0 ? "false" : "true")); |
| 1159 | } |
Chad Brubaker | c845b2a | 2016-05-13 14:09:27 -0700 | [diff] [blame] | 1160 | if (networkSecurityConfigRes != 0) { |
| 1161 | pw.println(prefix + "networkSecurityConfigRes=0x" |
| 1162 | + Integer.toHexString(networkSecurityConfigRes)); |
| 1163 | } |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 1164 | if (category != CATEGORY_UNDEFINED) { |
| 1165 | pw.println(prefix + "category=" + category); |
| 1166 | } |
Matthew Williams | 303650c | 2015-04-17 18:22:51 -0700 | [diff] [blame] | 1167 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1168 | super.dumpBack(pw, prefix); |
| 1169 | } |
Fabrice Di Meglio | 59dfce8 | 2012-04-02 16:17:20 -0700 | [diff] [blame] | 1170 | |
| 1171 | /** |
| 1172 | * @return true if "supportsRtl" has been set to true in the AndroidManifest |
| 1173 | * @hide |
| 1174 | */ |
| 1175 | public boolean hasRtlSupport() { |
| 1176 | return (flags & FLAG_SUPPORTS_RTL) == FLAG_SUPPORTS_RTL; |
| 1177 | } |
Jeff Sharkey | ba75a9b | 2016-01-07 11:51:33 -0700 | [diff] [blame] | 1178 | |
| 1179 | /** {@hide} */ |
| 1180 | public boolean hasCode() { |
| 1181 | return (flags & FLAG_HAS_CODE) != 0; |
| 1182 | } |
| 1183 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1184 | public static class DisplayNameComparator |
| 1185 | implements Comparator<ApplicationInfo> { |
| 1186 | public DisplayNameComparator(PackageManager pm) { |
| 1187 | mPM = pm; |
| 1188 | } |
| 1189 | |
| 1190 | public final int compare(ApplicationInfo aa, ApplicationInfo ab) { |
| 1191 | CharSequence sa = mPM.getApplicationLabel(aa); |
| 1192 | if (sa == null) { |
| 1193 | sa = aa.packageName; |
| 1194 | } |
| 1195 | CharSequence sb = mPM.getApplicationLabel(ab); |
| 1196 | if (sb == null) { |
| 1197 | sb = ab.packageName; |
| 1198 | } |
| 1199 | |
| 1200 | return sCollator.compare(sa.toString(), sb.toString()); |
| 1201 | } |
| 1202 | |
| 1203 | private final Collator sCollator = Collator.getInstance(); |
| 1204 | private PackageManager mPM; |
| 1205 | } |
| 1206 | |
| 1207 | public ApplicationInfo() { |
| 1208 | } |
| 1209 | |
| 1210 | public ApplicationInfo(ApplicationInfo orig) { |
| 1211 | super(orig); |
| 1212 | taskAffinity = orig.taskAffinity; |
| 1213 | permission = orig.permission; |
| 1214 | processName = orig.processName; |
| 1215 | className = orig.className; |
| 1216 | theme = orig.theme; |
| 1217 | flags = orig.flags; |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 1218 | privateFlags = orig.privateFlags; |
Dianne Hackborn | df6e980 | 2011-05-26 14:20:23 -0700 | [diff] [blame] | 1219 | requiresSmallestWidthDp = orig.requiresSmallestWidthDp; |
| 1220 | compatibleWidthLimitDp = orig.compatibleWidthLimitDp; |
Dianne Hackborn | 2762ff3 | 2011-06-01 21:27:05 -0700 | [diff] [blame] | 1221 | largestWidthLimitDp = orig.largestWidthLimitDp; |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 1222 | volumeUuid = orig.volumeUuid; |
Jeff Sharkey | 789a8fc | 2017-04-16 13:18:35 -0600 | [diff] [blame] | 1223 | storageUuid = orig.storageUuid; |
Jeff Sharkey | 7f1a57a | 2014-10-08 10:14:53 -0700 | [diff] [blame] | 1224 | scanSourceDir = orig.scanSourceDir; |
| 1225 | scanPublicSourceDir = orig.scanPublicSourceDir; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1226 | sourceDir = orig.sourceDir; |
| 1227 | publicSourceDir = orig.publicSourceDir; |
Adam Lesinski | 4e86281 | 2016-11-21 16:02:24 -0800 | [diff] [blame] | 1228 | splitNames = orig.splitNames; |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 1229 | splitSourceDirs = orig.splitSourceDirs; |
| 1230 | splitPublicSourceDirs = orig.splitPublicSourceDirs; |
Adam Lesinski | 4e86281 | 2016-11-21 16:02:24 -0800 | [diff] [blame] | 1231 | splitDependencies = orig.splitDependencies; |
Kenny Root | 85387d7 | 2010-08-26 10:13:11 -0700 | [diff] [blame] | 1232 | nativeLibraryDir = orig.nativeLibraryDir; |
Narayan Kamath | 7dba6eb | 2014-07-16 08:53:30 +0100 | [diff] [blame] | 1233 | secondaryNativeLibraryDir = orig.secondaryNativeLibraryDir; |
Jeff Sharkey | 84f1294 | 2014-07-10 17:48:11 -0700 | [diff] [blame] | 1234 | nativeLibraryRootDir = orig.nativeLibraryRootDir; |
| 1235 | nativeLibraryRootRequiresIsa = orig.nativeLibraryRootRequiresIsa; |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 1236 | primaryCpuAbi = orig.primaryCpuAbi; |
| 1237 | secondaryCpuAbi = orig.secondaryCpuAbi; |
Kenny Root | d1ab016 | 2010-01-21 17:27:14 -0800 | [diff] [blame] | 1238 | resourceDirs = orig.resourceDirs; |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 1239 | seInfo = orig.seInfo; |
| 1240 | seInfoUser = orig.seInfoUser; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1241 | sharedLibraryFiles = orig.sharedLibraryFiles; |
| 1242 | dataDir = orig.dataDir; |
Jeff Sharkey | dd9bda8 | 2017-02-23 17:38:31 -0700 | [diff] [blame] | 1243 | deviceProtectedDataDir = orig.deviceProtectedDataDir; |
| 1244 | credentialProtectedDataDir = orig.credentialProtectedDataDir; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1245 | uid = orig.uid; |
Todd Kennedy | 89d6018 | 2016-03-11 11:18:32 -0800 | [diff] [blame] | 1246 | minSdkVersion = orig.minSdkVersion; |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 1247 | targetSdkVersion = orig.targetSdkVersion; |
Dianne Hackborn | 8472e61 | 2014-01-23 17:57:20 -0800 | [diff] [blame] | 1248 | versionCode = orig.versionCode; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1249 | enabled = orig.enabled; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 1250 | enabledSetting = orig.enabledSetting; |
Dianne Hackborn | 54e570f | 2010-10-04 18:32:32 -0700 | [diff] [blame] | 1251 | installLocation = orig.installLocation; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1252 | manageSpaceActivityName = orig.manageSpaceActivityName; |
| 1253 | descriptionRes = orig.descriptionRes; |
Adam Powell | 269248d | 2011-08-02 10:26:54 -0700 | [diff] [blame] | 1254 | uiOptions = orig.uiOptions; |
Christopher Tate | bcb0255 | 2012-10-16 17:14:34 -0700 | [diff] [blame] | 1255 | backupAgentName = orig.backupAgentName; |
Matthew Williams | 303650c | 2015-04-17 18:22:51 -0700 | [diff] [blame] | 1256 | fullBackupContent = orig.fullBackupContent; |
Chad Brubaker | c845b2a | 2016-05-13 14:09:27 -0700 | [diff] [blame] | 1257 | networkSecurityConfigRes = orig.networkSecurityConfigRes; |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 1258 | category = orig.category; |
Todd Kennedy | 11e4507 | 2017-01-25 13:24:21 -0800 | [diff] [blame] | 1259 | targetSandboxVersion = orig.targetSandboxVersion; |
Narayan Kamath | f9419f0 | 2017-06-15 11:35:38 +0100 | [diff] [blame] | 1260 | classLoaderName = orig.classLoaderName; |
| 1261 | splitClassLoaderNames = orig.splitClassLoaderNames; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1262 | } |
| 1263 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1264 | public String toString() { |
| 1265 | return "ApplicationInfo{" |
| 1266 | + Integer.toHexString(System.identityHashCode(this)) |
| 1267 | + " " + packageName + "}"; |
| 1268 | } |
| 1269 | |
| 1270 | public int describeContents() { |
| 1271 | return 0; |
| 1272 | } |
| 1273 | |
Adam Lesinski | 4e86281 | 2016-11-21 16:02:24 -0800 | [diff] [blame] | 1274 | @SuppressWarnings("unchecked") |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1275 | public void writeToParcel(Parcel dest, int parcelableFlags) { |
| 1276 | super.writeToParcel(dest, parcelableFlags); |
| 1277 | dest.writeString(taskAffinity); |
| 1278 | dest.writeString(permission); |
| 1279 | dest.writeString(processName); |
| 1280 | dest.writeString(className); |
| 1281 | dest.writeInt(theme); |
| 1282 | dest.writeInt(flags); |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 1283 | dest.writeInt(privateFlags); |
Dianne Hackborn | df6e980 | 2011-05-26 14:20:23 -0700 | [diff] [blame] | 1284 | dest.writeInt(requiresSmallestWidthDp); |
| 1285 | dest.writeInt(compatibleWidthLimitDp); |
Dianne Hackborn | 2762ff3 | 2011-06-01 21:27:05 -0700 | [diff] [blame] | 1286 | dest.writeInt(largestWidthLimitDp); |
Jeff Sharkey | 67c8c1e | 2017-04-19 11:22:02 -0600 | [diff] [blame] | 1287 | if (storageUuid != null) { |
| 1288 | dest.writeInt(1); |
Jeff Sharkey | a4d34d9 | 2017-04-27 11:21:41 -0600 | [diff] [blame] | 1289 | dest.writeLong(storageUuid.getMostSignificantBits()); |
| 1290 | dest.writeLong(storageUuid.getLeastSignificantBits()); |
Jeff Sharkey | 67c8c1e | 2017-04-19 11:22:02 -0600 | [diff] [blame] | 1291 | } else { |
| 1292 | dest.writeInt(0); |
| 1293 | } |
Jeff Sharkey | 7f1a57a | 2014-10-08 10:14:53 -0700 | [diff] [blame] | 1294 | dest.writeString(scanSourceDir); |
| 1295 | dest.writeString(scanPublicSourceDir); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1296 | dest.writeString(sourceDir); |
| 1297 | dest.writeString(publicSourceDir); |
Adam Lesinski | 4e86281 | 2016-11-21 16:02:24 -0800 | [diff] [blame] | 1298 | dest.writeStringArray(splitNames); |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 1299 | dest.writeStringArray(splitSourceDirs); |
| 1300 | dest.writeStringArray(splitPublicSourceDirs); |
Adam Lesinski | 1665d0f | 2017-03-10 14:46:57 -0800 | [diff] [blame] | 1301 | dest.writeSparseArray((SparseArray) splitDependencies); |
Kenny Root | 85387d7 | 2010-08-26 10:13:11 -0700 | [diff] [blame] | 1302 | dest.writeString(nativeLibraryDir); |
Narayan Kamath | 7dba6eb | 2014-07-16 08:53:30 +0100 | [diff] [blame] | 1303 | dest.writeString(secondaryNativeLibraryDir); |
Jeff Sharkey | 84f1294 | 2014-07-10 17:48:11 -0700 | [diff] [blame] | 1304 | dest.writeString(nativeLibraryRootDir); |
| 1305 | dest.writeInt(nativeLibraryRootRequiresIsa ? 1 : 0); |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 1306 | dest.writeString(primaryCpuAbi); |
| 1307 | dest.writeString(secondaryCpuAbi); |
Kenny Root | d1ab016 | 2010-01-21 17:27:14 -0800 | [diff] [blame] | 1308 | dest.writeStringArray(resourceDirs); |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 1309 | dest.writeString(seInfo); |
| 1310 | dest.writeString(seInfoUser); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1311 | dest.writeStringArray(sharedLibraryFiles); |
| 1312 | dest.writeString(dataDir); |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 1313 | dest.writeString(deviceProtectedDataDir); |
| 1314 | dest.writeString(credentialProtectedDataDir); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1315 | dest.writeInt(uid); |
Todd Kennedy | 6e2e7f5 | 2016-05-02 14:56:45 -0700 | [diff] [blame] | 1316 | dest.writeInt(minSdkVersion); |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 1317 | dest.writeInt(targetSdkVersion); |
Dianne Hackborn | 8472e61 | 2014-01-23 17:57:20 -0800 | [diff] [blame] | 1318 | dest.writeInt(versionCode); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1319 | dest.writeInt(enabled ? 1 : 0); |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 1320 | dest.writeInt(enabledSetting); |
Dianne Hackborn | 54e570f | 2010-10-04 18:32:32 -0700 | [diff] [blame] | 1321 | dest.writeInt(installLocation); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1322 | dest.writeString(manageSpaceActivityName); |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 1323 | dest.writeString(backupAgentName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1324 | dest.writeInt(descriptionRes); |
Adam Powell | 269248d | 2011-08-02 10:26:54 -0700 | [diff] [blame] | 1325 | dest.writeInt(uiOptions); |
Matthew Williams | 303650c | 2015-04-17 18:22:51 -0700 | [diff] [blame] | 1326 | dest.writeInt(fullBackupContent); |
Chad Brubaker | c845b2a | 2016-05-13 14:09:27 -0700 | [diff] [blame] | 1327 | dest.writeInt(networkSecurityConfigRes); |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 1328 | dest.writeInt(category); |
Todd Kennedy | 11e4507 | 2017-01-25 13:24:21 -0800 | [diff] [blame] | 1329 | dest.writeInt(targetSandboxVersion); |
Narayan Kamath | f9419f0 | 2017-06-15 11:35:38 +0100 | [diff] [blame] | 1330 | dest.writeString(classLoaderName); |
| 1331 | dest.writeStringArray(splitClassLoaderNames); |
Alan Viverette | b6a2573 | 2017-11-21 14:49:24 -0500 | [diff] [blame^] | 1332 | dest.writeInt(compileSdkVersion); |
| 1333 | dest.writeString(compileSdkVersionCodename); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1334 | } |
| 1335 | |
| 1336 | public static final Parcelable.Creator<ApplicationInfo> CREATOR |
| 1337 | = new Parcelable.Creator<ApplicationInfo>() { |
| 1338 | public ApplicationInfo createFromParcel(Parcel source) { |
| 1339 | return new ApplicationInfo(source); |
| 1340 | } |
| 1341 | public ApplicationInfo[] newArray(int size) { |
| 1342 | return new ApplicationInfo[size]; |
| 1343 | } |
| 1344 | }; |
| 1345 | |
Adam Lesinski | 4e86281 | 2016-11-21 16:02:24 -0800 | [diff] [blame] | 1346 | @SuppressWarnings("unchecked") |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1347 | private ApplicationInfo(Parcel source) { |
| 1348 | super(source); |
| 1349 | taskAffinity = source.readString(); |
| 1350 | permission = source.readString(); |
| 1351 | processName = source.readString(); |
| 1352 | className = source.readString(); |
| 1353 | theme = source.readInt(); |
| 1354 | flags = source.readInt(); |
Alex Klyubin | b9f8a52 | 2015-02-03 11:12:59 -0800 | [diff] [blame] | 1355 | privateFlags = source.readInt(); |
Dianne Hackborn | df6e980 | 2011-05-26 14:20:23 -0700 | [diff] [blame] | 1356 | requiresSmallestWidthDp = source.readInt(); |
| 1357 | compatibleWidthLimitDp = source.readInt(); |
Dianne Hackborn | 2762ff3 | 2011-06-01 21:27:05 -0700 | [diff] [blame] | 1358 | largestWidthLimitDp = source.readInt(); |
Jeff Sharkey | 67c8c1e | 2017-04-19 11:22:02 -0600 | [diff] [blame] | 1359 | if (source.readInt() != 0) { |
Jeff Sharkey | a4d34d9 | 2017-04-27 11:21:41 -0600 | [diff] [blame] | 1360 | storageUuid = new UUID(source.readLong(), source.readLong()); |
Jeff Sharkey | 67c8c1e | 2017-04-19 11:22:02 -0600 | [diff] [blame] | 1361 | volumeUuid = StorageManager.convert(storageUuid); |
| 1362 | } |
Jeff Sharkey | 7f1a57a | 2014-10-08 10:14:53 -0700 | [diff] [blame] | 1363 | scanSourceDir = source.readString(); |
| 1364 | scanPublicSourceDir = source.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1365 | sourceDir = source.readString(); |
| 1366 | publicSourceDir = source.readString(); |
Adam Lesinski | 4e86281 | 2016-11-21 16:02:24 -0800 | [diff] [blame] | 1367 | splitNames = source.readStringArray(); |
Jeff Sharkey | 8a4c972 | 2014-06-16 13:48:42 -0700 | [diff] [blame] | 1368 | splitSourceDirs = source.readStringArray(); |
| 1369 | splitPublicSourceDirs = source.readStringArray(); |
Adam Lesinski | 1665d0f | 2017-03-10 14:46:57 -0800 | [diff] [blame] | 1370 | splitDependencies = source.readSparseArray(null); |
Kenny Root | 85387d7 | 2010-08-26 10:13:11 -0700 | [diff] [blame] | 1371 | nativeLibraryDir = source.readString(); |
Narayan Kamath | 7dba6eb | 2014-07-16 08:53:30 +0100 | [diff] [blame] | 1372 | secondaryNativeLibraryDir = source.readString(); |
Jeff Sharkey | 84f1294 | 2014-07-10 17:48:11 -0700 | [diff] [blame] | 1373 | nativeLibraryRootDir = source.readString(); |
| 1374 | nativeLibraryRootRequiresIsa = source.readInt() != 0; |
Narayan Kamath | ff110bd | 2014-07-04 18:30:45 +0100 | [diff] [blame] | 1375 | primaryCpuAbi = source.readString(); |
| 1376 | secondaryCpuAbi = source.readString(); |
Kenny Root | d1ab016 | 2010-01-21 17:27:14 -0800 | [diff] [blame] | 1377 | resourceDirs = source.readStringArray(); |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 1378 | seInfo = source.readString(); |
| 1379 | seInfoUser = source.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1380 | sharedLibraryFiles = source.readStringArray(); |
| 1381 | dataDir = source.readString(); |
Jeff Sharkey | dd9bda8 | 2017-02-23 17:38:31 -0700 | [diff] [blame] | 1382 | deviceProtectedDataDir = source.readString(); |
| 1383 | credentialProtectedDataDir = source.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1384 | uid = source.readInt(); |
Todd Kennedy | 6e2e7f5 | 2016-05-02 14:56:45 -0700 | [diff] [blame] | 1385 | minSdkVersion = source.readInt(); |
Dianne Hackborn | a96cbb4 | 2009-05-13 15:06:13 -0700 | [diff] [blame] | 1386 | targetSdkVersion = source.readInt(); |
Dianne Hackborn | 8472e61 | 2014-01-23 17:57:20 -0800 | [diff] [blame] | 1387 | versionCode = source.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1388 | enabled = source.readInt() != 0; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 1389 | enabledSetting = source.readInt(); |
Dianne Hackborn | 54e570f | 2010-10-04 18:32:32 -0700 | [diff] [blame] | 1390 | installLocation = source.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1391 | manageSpaceActivityName = source.readString(); |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 1392 | backupAgentName = source.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1393 | descriptionRes = source.readInt(); |
Adam Powell | 269248d | 2011-08-02 10:26:54 -0700 | [diff] [blame] | 1394 | uiOptions = source.readInt(); |
Matthew Williams | 303650c | 2015-04-17 18:22:51 -0700 | [diff] [blame] | 1395 | fullBackupContent = source.readInt(); |
Chad Brubaker | c845b2a | 2016-05-13 14:09:27 -0700 | [diff] [blame] | 1396 | networkSecurityConfigRes = source.readInt(); |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 1397 | category = source.readInt(); |
Todd Kennedy | 11e4507 | 2017-01-25 13:24:21 -0800 | [diff] [blame] | 1398 | targetSandboxVersion = source.readInt(); |
Narayan Kamath | f9419f0 | 2017-06-15 11:35:38 +0100 | [diff] [blame] | 1399 | classLoaderName = source.readString(); |
| 1400 | splitClassLoaderNames = source.readStringArray(); |
Alan Viverette | b6a2573 | 2017-11-21 14:49:24 -0500 | [diff] [blame^] | 1401 | compileSdkVersion = source.readInt(); |
| 1402 | compileSdkVersionCodename = source.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1403 | } |
Mitsuru Oshima | 8d11267 | 2009-04-27 12:01:23 -0700 | [diff] [blame] | 1404 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1405 | /** |
| 1406 | * Retrieve the textual description of the application. This |
| 1407 | * will call back on the given PackageManager to load the description from |
| 1408 | * the application. |
| 1409 | * |
| 1410 | * @param pm A PackageManager from which the label can be loaded; usually |
| 1411 | * the PackageManager from which you originally retrieved this item. |
| 1412 | * |
| 1413 | * @return Returns a CharSequence containing the application's description. |
| 1414 | * If there is no description, null is returned. |
| 1415 | */ |
| 1416 | public CharSequence loadDescription(PackageManager pm) { |
| 1417 | if (descriptionRes != 0) { |
Jeff Brown | 0733079 | 2010-03-30 19:57:08 -0700 | [diff] [blame] | 1418 | CharSequence label = pm.getText(packageName, descriptionRes, this); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1419 | if (label != null) { |
| 1420 | return label; |
| 1421 | } |
| 1422 | } |
| 1423 | return null; |
| 1424 | } |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 1425 | |
| 1426 | /** |
| 1427 | * Disable compatibility mode |
| 1428 | * |
| 1429 | * @hide |
| 1430 | */ |
| 1431 | public void disableCompatibilityMode() { |
Mitsuru Oshima | 69fff4a | 2009-07-21 09:51:05 -0700 | [diff] [blame] | 1432 | flags |= (FLAG_SUPPORTS_LARGE_SCREENS | FLAG_SUPPORTS_NORMAL_SCREENS | |
Dianne Hackborn | 11b822d | 2009-07-21 20:03:02 -0700 | [diff] [blame] | 1433 | FLAG_SUPPORTS_SMALL_SCREENS | FLAG_RESIZEABLE_FOR_SCREENS | |
Dianne Hackborn | 14cee9f | 2010-04-23 17:51:26 -0700 | [diff] [blame] | 1434 | FLAG_SUPPORTS_SCREEN_DENSITIES | FLAG_SUPPORTS_XLARGE_SCREENS); |
Mitsuru Oshima | e5fb328 | 2009-06-09 21:16:08 -0700 | [diff] [blame] | 1435 | } |
Jeff Sharkey | 1544779 | 2015-11-05 16:18:51 -0800 | [diff] [blame] | 1436 | |
skuhne@google.com | 7e85eb0 | 2017-01-04 13:49:54 -0800 | [diff] [blame] | 1437 | /** |
| 1438 | * Is using compatibility mode for non densty aware legacy applications. |
| 1439 | * |
| 1440 | * @hide |
| 1441 | */ |
| 1442 | public boolean usesCompatibilityMode() { |
| 1443 | return targetSdkVersion < DONUT || |
| 1444 | (flags & (FLAG_SUPPORTS_LARGE_SCREENS | FLAG_SUPPORTS_NORMAL_SCREENS | |
| 1445 | FLAG_SUPPORTS_SMALL_SCREENS | FLAG_RESIZEABLE_FOR_SCREENS | |
| 1446 | FLAG_SUPPORTS_SCREEN_DENSITIES | FLAG_SUPPORTS_XLARGE_SCREENS)) == 0; |
| 1447 | } |
| 1448 | |
Jeff Sharkey | 1544779 | 2015-11-05 16:18:51 -0800 | [diff] [blame] | 1449 | /** {@hide} */ |
| 1450 | public void initForUser(int userId) { |
| 1451 | uid = UserHandle.getUid(userId, UserHandle.getAppId(uid)); |
| 1452 | |
| 1453 | if ("android".equals(packageName)) { |
| 1454 | dataDir = Environment.getDataSystemDirectory().getAbsolutePath(); |
| 1455 | return; |
| 1456 | } |
| 1457 | |
Jeff Sharkey | dd9bda8 | 2017-02-23 17:38:31 -0700 | [diff] [blame] | 1458 | deviceProtectedDataDir = Environment |
Jeff Sharkey | 8212ae0 | 2016-02-10 14:46:43 -0700 | [diff] [blame] | 1459 | .getDataUserDePackageDirectory(volumeUuid, userId, packageName) |
Jeff Sharkey | 1544779 | 2015-11-05 16:18:51 -0800 | [diff] [blame] | 1460 | .getAbsolutePath(); |
Jeff Sharkey | dd9bda8 | 2017-02-23 17:38:31 -0700 | [diff] [blame] | 1461 | credentialProtectedDataDir = Environment |
Jeff Sharkey | 8212ae0 | 2016-02-10 14:46:43 -0700 | [diff] [blame] | 1462 | .getDataUserCePackageDirectory(volumeUuid, userId, packageName) |
Jeff Sharkey | 1544779 | 2015-11-05 16:18:51 -0800 | [diff] [blame] | 1463 | .getAbsolutePath(); |
| 1464 | |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 1465 | if ((privateFlags & PRIVATE_FLAG_DEFAULT_TO_DEVICE_PROTECTED_STORAGE) != 0 |
| 1466 | && PackageManager.APPLY_DEFAULT_TO_DEVICE_PROTECTED_STORAGE) { |
| 1467 | dataDir = deviceProtectedDataDir; |
Jeff Sharkey | 1544779 | 2015-11-05 16:18:51 -0800 | [diff] [blame] | 1468 | } else { |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 1469 | dataDir = credentialProtectedDataDir; |
Jeff Sharkey | 1544779 | 2015-11-05 16:18:51 -0800 | [diff] [blame] | 1470 | } |
| 1471 | } |
| 1472 | |
Jeff Brown | 0733079 | 2010-03-30 19:57:08 -0700 | [diff] [blame] | 1473 | /** |
| 1474 | * @hide |
| 1475 | */ |
Alexandra Gherghina | a709314 | 2014-07-30 13:43:39 +0100 | [diff] [blame] | 1476 | @Override |
| 1477 | public Drawable loadDefaultIcon(PackageManager pm) { |
Jeff Brown | 0733079 | 2010-03-30 19:57:08 -0700 | [diff] [blame] | 1478 | if ((flags & FLAG_EXTERNAL_STORAGE) != 0 |
| 1479 | && isPackageUnavailable(pm)) { |
| 1480 | return Resources.getSystem().getDrawable( |
| 1481 | com.android.internal.R.drawable.sym_app_on_sd_unavailable_icon); |
| 1482 | } |
| 1483 | return pm.getDefaultActivityIcon(); |
| 1484 | } |
| 1485 | |
| 1486 | private boolean isPackageUnavailable(PackageManager pm) { |
| 1487 | try { |
| 1488 | return pm.getPackageInfo(packageName, 0) == null; |
| 1489 | } catch (NameNotFoundException ex) { |
| 1490 | return true; |
| 1491 | } |
| 1492 | } |
Jeff Sharkey | d746057 | 2014-07-06 20:44:55 -0700 | [diff] [blame] | 1493 | |
Jeff Sharkey | f9fc6d6 | 2015-11-08 16:46:05 -0800 | [diff] [blame] | 1494 | /** @hide */ |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 1495 | public boolean isDefaultToDeviceProtectedStorage() { |
| 1496 | return (privateFlags |
| 1497 | & ApplicationInfo.PRIVATE_FLAG_DEFAULT_TO_DEVICE_PROTECTED_STORAGE) != 0; |
Jeff Sharkey | e469713 | 2016-02-06 19:46:15 -0700 | [diff] [blame] | 1498 | } |
| 1499 | |
| 1500 | /** @hide */ |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 1501 | public boolean isDirectBootAware() { |
| 1502 | return (privateFlags & ApplicationInfo.PRIVATE_FLAG_DIRECT_BOOT_AWARE) != 0; |
Jeff Sharkey | f9fc6d6 | 2015-11-08 16:46:05 -0800 | [diff] [blame] | 1503 | } |
| 1504 | |
Jeff Sharkey | 8924e87 | 2015-11-30 12:52:10 -0700 | [diff] [blame] | 1505 | /** @hide */ |
Todd Kennedy | c29b11a | 2017-10-23 15:55:59 -0700 | [diff] [blame] | 1506 | public boolean isEncryptionAware() { |
| 1507 | return isDirectBootAware() || isPartiallyDirectBootAware(); |
| 1508 | } |
| 1509 | |
| 1510 | /** @hide */ |
| 1511 | public boolean isExternal() { |
| 1512 | return (flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0; |
| 1513 | } |
| 1514 | |
| 1515 | /** @hide */ |
| 1516 | public boolean isExternalAsec() { |
| 1517 | return TextUtils.isEmpty(volumeUuid) && isExternal(); |
| 1518 | } |
| 1519 | |
| 1520 | /** @hide */ |
| 1521 | public boolean isForwardLocked() { |
| 1522 | return (privateFlags & ApplicationInfo.PRIVATE_FLAG_FORWARD_LOCK) != 0; |
| 1523 | } |
| 1524 | |
| 1525 | /** @hide */ |
| 1526 | public boolean isInstantApp() { |
| 1527 | return (privateFlags & ApplicationInfo.PRIVATE_FLAG_INSTANT) != 0; |
| 1528 | } |
| 1529 | |
| 1530 | /** @hide */ |
| 1531 | public boolean isInternal() { |
| 1532 | return (flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) == 0; |
| 1533 | } |
| 1534 | |
| 1535 | /** @hide */ |
| 1536 | public boolean isOem() { |
| 1537 | return (privateFlags & ApplicationInfo.PRIVATE_FLAG_OEM) != 0; |
| 1538 | } |
| 1539 | |
| 1540 | /** @hide */ |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 1541 | public boolean isPartiallyDirectBootAware() { |
| 1542 | return (privateFlags & ApplicationInfo.PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE) != 0; |
Jeff Sharkey | 8924e87 | 2015-11-30 12:52:10 -0700 | [diff] [blame] | 1543 | } |
| 1544 | |
Bryce Lee | 8558ec7 | 2017-08-17 15:37:26 -0700 | [diff] [blame] | 1545 | /** @hide */ |
Todd Kennedy | c29b11a | 2017-10-23 15:55:59 -0700 | [diff] [blame] | 1546 | @TestApi |
| 1547 | public boolean isPrivilegedApp() { |
| 1548 | return (privateFlags & ApplicationInfo.PRIVATE_FLAG_PRIVILEGED) != 0; |
Bryce Lee | 8558ec7 | 2017-08-17 15:37:26 -0700 | [diff] [blame] | 1549 | } |
| 1550 | |
Todd Kennedy | c29b11a | 2017-10-23 15:55:59 -0700 | [diff] [blame] | 1551 | /** @hide */ |
Fyodor Kupolov | bdbc969 | 2015-12-14 13:11:13 -0800 | [diff] [blame] | 1552 | public boolean isRequiredForSystemUser() { |
| 1553 | return (privateFlags & ApplicationInfo.PRIVATE_FLAG_REQUIRED_FOR_SYSTEM_USER) != 0; |
| 1554 | } |
| 1555 | |
Todd Kennedy | c29b11a | 2017-10-23 15:55:59 -0700 | [diff] [blame] | 1556 | /** @hide */ |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 1557 | public boolean isStaticSharedLibrary() { |
| 1558 | return (privateFlags & ApplicationInfo.PRIVATE_FLAG_STATIC_SHARED_LIBRARY) != 0; |
| 1559 | } |
| 1560 | |
Todd Kennedy | c29b11a | 2017-10-23 15:55:59 -0700 | [diff] [blame] | 1561 | /** @hide */ |
| 1562 | @TestApi |
| 1563 | public boolean isSystemApp() { |
| 1564 | return (flags & ApplicationInfo.FLAG_SYSTEM) != 0; |
| 1565 | } |
| 1566 | |
| 1567 | /** @hide */ |
| 1568 | public boolean isUpdatedSystemApp() { |
| 1569 | return (flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0; |
| 1570 | } |
| 1571 | |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 1572 | /** |
Todd Kennedy | 5eb5a7d | 2017-08-01 07:42:47 -0700 | [diff] [blame] | 1573 | * Returns whether or not this application was installed as a virtual preload. |
| 1574 | */ |
| 1575 | public boolean isVirtualPreload() { |
| 1576 | return (privateFlags & PRIVATE_FLAG_VIRTUAL_PRELOAD) != 0; |
| 1577 | } |
| 1578 | |
| 1579 | /** |
Todd Kennedy | c29b11a | 2017-10-23 15:55:59 -0700 | [diff] [blame] | 1580 | * Returns true if the app has declared in its manifest that it wants its split APKs to be |
| 1581 | * loaded into isolated Contexts, with their own ClassLoaders and Resources objects. |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 1582 | * @hide |
| 1583 | */ |
Todd Kennedy | c29b11a | 2017-10-23 15:55:59 -0700 | [diff] [blame] | 1584 | public boolean requestsIsolatedSplitLoading() { |
| 1585 | return (privateFlags & ApplicationInfo.PRIVATE_FLAG_ISOLATED_SPLIT_LOADING) != 0; |
Svet Ganov | 087dce2 | 2017-09-07 15:42:16 -0700 | [diff] [blame] | 1586 | } |
| 1587 | |
| 1588 | /** |
| 1589 | * @hide |
| 1590 | */ |
Jeff Brown | 0733079 | 2010-03-30 19:57:08 -0700 | [diff] [blame] | 1591 | @Override protected ApplicationInfo getApplicationInfo() { |
| 1592 | return this; |
| 1593 | } |
Jeff Sharkey | d746057 | 2014-07-06 20:44:55 -0700 | [diff] [blame] | 1594 | |
| 1595 | /** {@hide} */ public void setCodePath(String codePath) { scanSourceDir = codePath; } |
| 1596 | /** {@hide} */ public void setBaseCodePath(String baseCodePath) { sourceDir = baseCodePath; } |
| 1597 | /** {@hide} */ public void setSplitCodePaths(String[] splitCodePaths) { splitSourceDirs = splitCodePaths; } |
| 1598 | /** {@hide} */ public void setResourcePath(String resourcePath) { scanPublicSourceDir = resourcePath; } |
| 1599 | /** {@hide} */ public void setBaseResourcePath(String baseResourcePath) { publicSourceDir = baseResourcePath; } |
| 1600 | /** {@hide} */ public void setSplitResourcePaths(String[] splitResourcePaths) { splitPublicSourceDirs = splitResourcePaths; } |
| 1601 | |
| 1602 | /** {@hide} */ public String getCodePath() { return scanSourceDir; } |
| 1603 | /** {@hide} */ public String getBaseCodePath() { return sourceDir; } |
| 1604 | /** {@hide} */ public String[] getSplitCodePaths() { return splitSourceDirs; } |
| 1605 | /** {@hide} */ public String getResourcePath() { return scanPublicSourceDir; } |
| 1606 | /** {@hide} */ public String getBaseResourcePath() { return publicSourceDir; } |
Jeff Sharkey | a3a43b0 | 2016-11-15 17:54:23 -0700 | [diff] [blame] | 1607 | /** {@hide} */ public String[] getSplitResourcePaths() { return splitPublicSourceDirs; } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1608 | } |